OpnSrcConstruction
10/29/2018 - 12:57 AM

Python If_else statement example

First I assign a variable. Then I compare that variable to see if it's a 4, and if not then(else) it prints 0.

'''
@author: OpnSrcConstruction
'''
 

x = 5

if x == 4:
    print('x is equal to 4')
else:
    print('x is not equal to 0')