Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

In Python there is not a switch/case statement, however this can be worked round using nested if..elif..else comandscommands.

Code Block
 var = "aa"
 if var in ( "a", "aa", "aaa" ) : print "it is a kind of a ";
 elif var in ( "b", "bb", "bb" ) :print "it is a kind of b ";
 else : print "it is something else ";

...