Now while using this elif...to my own understanding ...is it the same thing as saying Unless... | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Now while using this elif...to my own understanding ...is it the same thing as saying Unless...

elif

4th May 2020, 4:27 PM
Ollayiwola caleb
3 Answers
+ 2
if traffic_light=='red': wait elif traffic_light=='green': go
4th May 2020, 4:46 PM
HonFu
HonFu - avatar
+ 1
I would not say so. if x: bla unless y: bla This would mean that unless had to be checked first. (Even then I don't understand what exactly should happen.) But that's not how it works. if money>1000: buy good pc elif money [not>1000! but]>500: buy ok pc else [money not>1000 and not >500]: do with the old one It is like a fork in the road.
4th May 2020, 4:43 PM
HonFu
HonFu - avatar
0
Pls use something easy and explain...am confused right now...
4th May 2020, 4:45 PM
Ollayiwola caleb