Learn Python CONDITIONAL EXPRESSIONS in 5 minutes! ❓
Вставка
- Опубліковано 28 вер 2024
- conditional expression = A one-line shortcut for the if-else statement (ternary operator)
Print or assign one of two values based on a condition
X if condition else Y
# conditional expression = A one-line shortcut for the if-else statement (ternary operator)
# Print or assign one of two values based on a condition
# X if condition else Y
num = 5
a = 6
b = 7
age = 13
temperature = 20
user_role = "guest"
print("Positive" if num > 0 else "Negative")
result = "EVEN" if num % 2 == 0 else "ODD"
max_num = a if a > b else b
min_num = a if a < b else b
status = "Adult" if age >= 18 else "Child"
weather = "HOT" if temperature > 20 else "COLD"
access_level = "Full Access" if user_role == "admin" else "Limited Access"
hey bro i like you explanation can you plz create networking course for us
Best Channel with best teaching style
Best for me good trainer, i really learn Python & so many things from your channel....From Bangladesh 🇧🇩❤️
It's best channel to learn to code thanks maan ❤
I have been watching his videos for 1 month, and I absolutely love it
Thanks... I applied if else like you taught:
age = int(input("Enter your age: ")
print("Toddler" if age = 4 and age = 13 and age = 20 and age = 36 and age
I love your lessons Bro. Thanks!!!
user = input("User Status "
"
1. Admin: "
"
2. Moderator: "
"
3. Guest: "
"
Input your status (1/2/3): ")
access = "Full Access: You are in!" if user == "1" else (
"Limited Access: Good luck!" if user == "2" else ("Access Denied" if user == "3" else "Wrong Input"))
print(access)
Thank you. Once you started using words instead of numbers it finally clicked into my head .
Thanks for teaching me python
tommorrow is my last python test :D
hey bro i rlly like ur vids i always watch them if im confused with something
but bro how to get a colour scheme of a terminal just like urs??
edit: i just watched ur 12 hours python video and u gave a tut for ur colour scheme and font tysm bro!
Bro your the best at teaching!
Can you code on a laptop? Like what specs do you need?
Thanks ❤
Brooooo i need you to make tutorial on kotlin
Thank u so much for this...
Hey bro
Hello bro mind ❤ my comment ?
ok
im binge watching your Python tutorial playlist and i love it. You are the best teacher ive ever seen.
Thanks for making this for free
I am a Junior Developer and work extensively with Django. Your Python videos are absolutely phenomenal . I am currently going through all of them and they are helping me get better clarity about many concepts. Kudos to you!
Bro a channel with 1M subs only getting 70 views? Bro you are underrated
Bro, upload swift programming language if you know. 👍
can you please do spring boot series all aboput java fullstack?
good channel but not pulling views?
Fill me with your code bro
vsauce music plays
pls do type hinting
15th comment
Bro, - your tuts are awesome!!!!!!! I love it so clear you made it and all understandable and so simple!!! Do you have any paid version of python courses where you go deep down the rabbit hole and gets higher difficulty in python? Or all you make are free courses? Thank you so much!
I love your teaching method
Can you please teach us android app development?
you are THE gigachad, man, not only teach others to program, but getting money to the hospital, you're the best!
your c# course is so good btw
BRO IS SUPER UNDERRATED