Unit 1 Lab Question Bank
Unit 1 Lab Question Bank
4. Chef has infinite coins in denominations of rupees 5 and rupees 10. Find the minimum
number of coins Chef needs, to pay exactly X rupees. If it is impossible to pay X rupees in
denominations of rupees 5 and 10 only, print − 1 .
5. Write a python program to construct the following pattern using nested for loop:
**
***
****
*****
*****
****
***
**
9. Write a Python program to print the factorial of all numbers between a and b.
10. Create a Python program that prints left Pascal triangle pattern .The program should
accept a number n from the user, which determines the number of rows of the pyramid.
The numbers should increase from 1 at the top to n and then decrease symmetrically on
each row.
11. Write a Python program that prints a right-angled triangle using stars (*). The program should
accept a number n from the user, which determines the number of rows of the triangle.
12. Write a Python program to print the sum of first 100 odd numbers.
55555
4444
333
22
**
***
****
*****
16. Develop a Python program to find the sum of odd and even numbers using for statement.