Professional Documents
Culture Documents
30-1-2024
Q1) Consider a scenario where a child eats five chocolates every day of week.
The price of each chocolate is different. His father pays the bill to the vendor at
the end of every week. Write a script that can generate the bill of the chocolates
after a week.
ANS days_of_week = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday',
'Saturday', 'Sunday']
chocolate_prices = [1.5, 2.0, 1.8, 1.2, 2.5, 1.0, 1.5]
total_bill = 0
(ii)
(iii)
(iv)
(v)
(iii) WAP to generate the following output (hint: use continue statement where
ever necessary)
print(j, end="")
print()
ii) for i in range(1, 6):
print(i, end="")
print()
iii) for i in range(6):
print()
iv) for i in range(6, 0, -1):
print(j, end="")
print()
v) for i in range(1, 6):
print()
iii) for i in range(1, 11):
result = 3 * i