What is a ternary operator in Python? #coding #python #programming

preview_player
Показать описание

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

People saying it's not a ternary operator without an explanation, as to why, boggles me. I spent a minute on google and this is literally what it says a ternary operator is; a way of writing an if-else statement in a single line. Also referred to as the ternary conditional operator.

Please, enlighten me and tell me what a ternary operator is instead of just saying it's wrong.

AzerHDable
Автор

No ternary operator and also
Lol you can just even do:

def can_access(role):
return role == ”admin“

Maybe learn basics first before creating tutorials

xer_ger