If/elif/else code differences? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 9

If/elif/else code differences?

hello i have tryed the following code and get the same result .... does py interpret the following code different? https://code.sololearn.com/cfQrc86s4eMw/?ref=app https://code.sololearn.com/cY895CUa9nYQ/?ref=app

3rd May 2017, 5:33 PM
Moersy
Moersy - avatar
4 Answers
+ 8
No, that's the same code, actually - both will work the same way. The properly indented is the more pythonic one, though 🐍
3rd May 2017, 5:40 PM
Kuba Siekierzyński
Kuba Siekierzyński - avatar
+ 6
ty for quick help ☺👍
5th May 2017, 4:13 AM
Moersy
Moersy - avatar
+ 2
By questioning this , you also have helped me to understand elif properly.Thanks man.
17th Nov 2017, 12:38 PM
Sourov Ajmain
Sourov Ajmain - avatar
0
both are same only
27th Aug 2017, 2:09 PM
chandan