Python conditionals: Difference between revisions

From wikinotes
(No difference)

Revision as of 17:37, 6 May 2018

if statement

if var == 'no' :
   print "something"
elif var == 'yes' :
   print "something else"
else:
   print "something else entirely"


You may find the all keyword useful:

if all([
    a == 1,
    b == 2,
    c == 3,
]):
    print('success')