You are on page 1of 2

In 

[1]: #SAMARTH SONI 22BCE11354

In [2]: #QUESTION 1

In [5]: lunch = input("What did you have for lunch? ")


money = int(input("How much money do you have? "))

if lunch == "fruit" or lunch == "sandwich":


if money >= 2:
print("Lunch being delivered")
else:
print("Can't deliver lunch")
else:
print("Can't deliver lunch")

What did you have for lunch? sandwich


How much money do you have? 3
Lunch being delivered

In [6]: #Question 2

In [7]: a = float(input("Enter the first number: "))


b = float(input("Enter the second number: "))
c = float(input("Enter the third number: "))

if a > b and a > c:


print(a, "is the largest number.")
elif b > a and b > c:
print(b, "is the largest number.")
else:
print(c, "is the largest number.")

Enter the first number: 3


Enter the second number: 5
Enter the third number: 10
10.0 is the largest number.

In [8]: #Question 3

In [9]: age = int(input("Enter your age: "))

if age >= 18:


print("You are eligible to vote!")
else:
print("Sorry, you are not eligible to vote yet.")

Enter your age: 19


You are eligible to vote!

In [10]: #Question 4
In [15]: marks=int(input("Enter the marks?"))
if marks>85 and marks<=100:
print("Congrats! you scored grade A ...")
elif marks>60 and marks<=85:
print("You scored grade B+ ...")
elif marks>40 and marks<=60:
print("You scored grade B ...")
elif(marks>30 and marks<=40):
print("You scored grade C ...")
else:
print("Sorry you are fail?")

Enter the marks?67


You scored grade B+ ...

You might also like