Hi Guys,
Today's target is if-else conditions. Very fundamental but extremely useful. Here is the simple example that I created for if-else conditions :
#Simple program to show if-else statements
x=input("Enter a number : ")
y=input("Enter a second number : ")
#Indentation is key function in python. There are no brackets in conditions anywhere.
#I prefer to use 4 space indentation
if x==y:
print("x is equal to y")
elif x > y:
print("x is greater than y")
else:
print("x is less than y")
Output :
No comments:
Post a Comment