Simple If Statement
x = 23
if x > 0:
print("x is positive value")
print("this is always printed")
x = -1
if x > 0:
print(x, "is positive number")
print("this is also always printed")
Output
If...Else statement
a = -7
if a > 0:
print(a, " is positive")
else:
print(a," is Negative")
output
Comments
Post a Comment