Professional Documents
Culture Documents
After
circling the field thrice, she runs back home for 12 metres. Write a program to
calculate the distance she covers in a week. If she loses 2 calories for every 25
metre of running, calculate and print the number of calories lost by Trisha in a week.
Program:
r=42
one_round = 2 * 22/7 * r
daily = 3 * one_round + 12
week = daily * 7
calorie = week / 25 * 2
Output:
Program:
p = 600000
plan1= p * 16 / 100 * 5
plan2 = p * 18 / 100 * 6
amount1= p + plan1
amount2= p + plan2
Output:
Program:
Output:
Program:
Output:
--------------------------------------------------------------------
--------------------------------------------------------------------
Television 5 125000
--------------------------------------------------------------------
Program:
tvsales = tv * 25000
mssales = ms * 10000
spsales = sp * 15000
print("-" * 60)
print("-" * 60)
print("Television",tv,tvsales,sep="\t\t")
print("Music system",ms,mssales,sep="\t\t")
print("Smart Phone",sp,spsales,sep="\t\t")
print("-" * 60)
print("\tGrand Total",totsales,sep="\t\t\t")
Output:
------------------------------------------------------------
------------------------------------------------------------
Television 5 125000
------------------------------------------------------------
Program:
s1 = d1/t1
s2 = d2/t2
if s1 > s2 :
else:
Output:
25 to 40 marks - Grade E
41 to 50 marks - Grade D
51 to 60 marks - Grade C
61 to 80 marks - Grade B
Ask user to enter marks of AI, Maths and Science. Calculate the average and print
the corresponding grade.
Program:
grade = 'A'
grade = 'B'
grade = 'C'
grade = 'D'
grade = 'E'
else:
grade = 'F'
Output:
Enter marks in AI 85
Program:
discount = 0
if amount >10000:
print("Discount is 10%")
print("Discount is 8%")
else:
print("No discount")
Output:
Discount is 8%
Program:
n=int(input("Enter a number"))
else:
Output:
Enter a number24
10. In a game of dice, you bet some money. If the dice shows 2 or 4, you win twice
the money. If the dice shows 1 or 6, you win 6 times the money and if the dice shows
any other number, you lose all the money. Write a program to accept the money you
bet and the number shown on rolling the dice. Display whether you win or lose and
the money you will get back.
Program:
if n==2 or n==4:
else:
Output: