mardi 8 janvier 2019

How do I check why my if_statement is not defined?

i'm try to test code below, but if_statement not defined

def if_statement(): """Three slightly difference versions of if: if, if-else, if-elif-else""" x=5 y=0 z=0 if x>0: print ("x is positive")

if y>0:
    print ("y is positive")
else:
    print ("y is not positve")

# elif can be repeated as often as possible
if z>0:
    print("z is positive")
elif z<0:
    print("z is nagetive")
else:
    print("z must be 0")

Aucun commentaire:

Enregistrer un commentaire