I want to write one-liner if statements when i can avoiding two lines of code.
if 10>5:
print( "10 is greater than 5" )
else:
print( "nothing here " )
Why the following statement is considered wrong and not being run?
print "10 is greater than 5" if 10>5 else print( "nothing here " )
Aucun commentaire:
Enregistrer un commentaire