PROGRAMMING PRACTICE/KNOWLEDGE BASED QUESTIONS
Chapter: Python Fundamentals
1. Write a program that displays a joke. But display the punchline only when the
user presses enter key. (Hint. You may use input()).
2. Write a program to read today's date (only del part) from user Then display how
many days are left in the current month.
3. Write a program that generates the following output
5
10
9
Assign value 5 to a variable using assignment operator (=) Multiply it with 2 to
generate 10 and subtract 1 to generate 9.
4. Modify above program so as to print output as 5@10@9.
5. Write the program with maxımum three lines of code and that assigns first 5
multiples of a number to 5 variables and then print them.
6. Write a Python program that accepts radius of circle and prints its area.
7. Write Python program that accepts marks in 5 subjects and outputs average marks.
8. Write a short program that asks tor your height in centimetres and then converts
your height to feet and inches. (1 foot = 12 inches, 1inch =2.54 cm).
9. Write a program to read a number n and print n2, n3 and n4.
10. Write a program to find area of a triangle.
11. Write a program to compute simple interest and compound interest.
12. Write a program to input a number and print its first five multiples.
13. Write a program to read details like name, class, age of a student and then
print the details firstly in same line and then in separate lines. Make sure to
have two blank lines in these two different types of prints.
14. Write a program to input a single digit(n) and print a 3 digit number created
as <n(n + 1)(n + 2)> e.g., if you input 7 then it should print 789. Assume that the
input digit is in range 1-7.
15. Write a program to read three numbers in three variables and swap first two
variables with the sums of first and second, second and third numbers respectively.