Which is not a reserved python keyword used for controlling program flow? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Which is not a reserved python keyword used for controlling program flow?

If, then, break or elif? Why??

30th Nov 2018, 4:16 PM
Elis Belen
2 Answers
+ 2
Among the ones you named, 'then' is not a keyword in Python. Why not? That's hard to answer! Every programming language has its own tools, and some are existent in one language but not in another. When would you need a 'then'? Maybe in if-clauses? 'If this then that?' in Python you for example write: if 1+1 == 2: print('Oh, really? ;)') elif 1+1 == 3: print("Now I'm surprised...") else: print("Something's broken.") It's all logical even without a 'then'.
30th Nov 2018, 4:27 PM
HonFu
HonFu - avatar
+ 7
I guess here 'then' is not a keyword in python rest all are keyword in python for control flow https://www.programiz.com/python-programming/keyword-list
30th Nov 2018, 4:19 PM
Rstar
Rstar - avatar