how to do if statements in python code example
Example 1: python if statement
usrinput = input(">> ")
if usrinput == "Hello":
print("Hi")
elif usrinput == "Bye":
print("Bye")
else:
print("Okay...?")
Example 2: or statement python
if x==1 or y==1:
print(x,y)
Example 3: if statement python
if (condition):
result
else:
result
Example 4: if statement python
x=1; y=0; z=0;
if 1 in {x,y,z}:
print('At least one variable is equal to 1')
Example 5: if statement python
a = 33
b = 200
if b > a:
print("b is greater than a")