Is there no switch function in Python
Rudi Hansen
rsh_remove_this_ at pobox.dk
Thu Sep 9 16:15:30 EDT 2004
More information about the Python-list mailing list
Thu Sep 9 16:15:30 EDT 2004
- Previous message (by thread): Is there no switch function in Python
- Next message (by thread): Is there no switch function in Python
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
I dont seem to be able to find the switch statement in Python.
I would like to be able to do
switch(var)
case 1 :
print "var = 1"
case 2:
print "var = 2"
But it seems that i have to do.
if(var=1)
print "var =1"
elseif(var=2)
print "var=2"
Is ther no easier way??
- Previous message (by thread): Is there no switch function in Python
- Next message (by thread): Is there no switch function in Python
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list