When and how can we use if and elif in phython | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

When and how can we use if and elif in phython

plzz explain?? https://www.sololearn.com/discuss/1360240/?ref=app

26th Jun 2018, 4:40 PM
Vansh
2 Answers
+ 3
you can use the if statements whenever you want to wave a choice for one thing or the other for example: x = 5 if x == 5 print “x is eaqual to 5” elif x == 7 print “x is eaqual to 7”
26th Jun 2018, 4:50 PM
Agent
Agent - avatar
+ 2
look at this code I made a while back https://code.sololearn.com/cFPFjvwDsXPr/?ref=app the bottom part
26th Jun 2018, 4:56 PM
LONGTIE👔
LONGTIE👔 - avatar