Conditional Statement in Python
#conditional statement
a=int(input("Enter the number :"))
if a==5 :
print("the value of a is 5")
b=10
c=a+b
print("sum is:", c)
print("I am in the last of if condition")
else:
print("the value of a is not equal to 5")
print("Hi I am out of if condition")
food=input("enter your favorite food :")
if food=='Rice' or food=='donut' or food=='Pizza' :
reply = 'Rice'
print(reply)
else:
reply="sorry I want burger"
print(reply)
# Imagine you have 6 subjects and Grand total is 600
Totalmarks = int(input(" Please Enter Your Total Marks: "))
if Totalmarks >= 540:
print(" Congratulations! ")
print(" You are eligible for Full Scholarship ")
elif Totalmarks >= 480:
print(" Congratulations! ")
print(" You are eligible for 50 Percent Scholarship ")
elif Totalmarks >= 400:
print(" Congratulations! ")
print(" You are eligible for 25 Percent Scholarship ")
elif Totalmarks >= 300:
print(" Congratulation")
print("You are eligible for 10 percent scholarship")
else:
print("Sorry! you are not eligible")
a = 5
b = 10
if a>=5 and b<=10:
print(" 1")
elif a<=5 and b<=10:
print(" 2 ")
elif a==5 and b==10:
print(" 3 ")
elif a<5 and b<5:
print(" 4 ")
else:
print(" You are Not eligible for Scholarship ")
print(" We are really Sorry for You ")
Comments
Post a Comment