+ 1
Which statement use in python for switch?
I need switch case.Plz help any one
6 Answers
+ 6
Python doesn't have switch statements, so you will have to do as Mickel SĂĄnchez suggested:
if condition:
#do something
elif condition:
#do something
else:
#do something else
+ 5
The alternative is if - elif - else as far as I know. Although for me it usually looks ugly.
+ 5
Here you have a good example.
https://www.tutorialspoint.com/JUMP_LINK__&&__python__&&__JUMP_LINK/python_if_else.htm
+ 2
thx
+ 2
thanks
+ 1
How to use