Ternary Operator - Python Tips and Tricks #4

preview_player
Показать описание
Today we learn about a special way of using if-statements in Python - the ternary operator.

◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾
📚 Programming Books & Merch 📚

🌐 Social Media & Contact 🌐

🖥️ My Coding Setup 🖥️

Рекомендации по теме
Комментарии
Автор

magic in one line. Really good. Where can I learn this sort one line codes in python?

JainmiahSk
Автор

Very useful trick! Thanks a lot for this video!

jrgomez
Автор

how to remove the unwanted text output which shows the whole file, folder location also

sudhansumtripathy
Автор

Again, your explanation and examples rival all others I have found. Thank you for doing what you do.

myvoicematters_
Автор

age = 18

adult = "You are an adult" if age >= 18 else "You are not an adult"
print(adult)

Thanks for the video, man!

ultraman
Автор

Thanx man thanx a million in power of zero❤

Dark_engine_er
Автор

Thanks man!! This is going to makr my life 10x easier

Zanamo
Автор

U are such a nice and cool guy i follow you on insta too

gauravsharma
Автор

Thx, but those ternary operators are nasty, could not get the AND operator to work, thus had an even uglier implementation of ternary operator code.

antman