CLASS X – PYTHON PROGRAMS (20)
5 SIMPLE PROGRAMS
1. Write a program to display the sum of two numbers.
2. Write a program to display the square of the number 5.
3. Write a program to swap two numbers.
4. Write a program to enter length and breadth. Calculate and print its area and perimeter.
5. Write a program to enter any number and print its cube.
5 IF–ELSE PROGRAMS
1. Write a program to input three digits from the user and print the greatest number.
2. Write a program to take a number and check whether it is even or odd.
3. Write a program to check divisibility of a number with another number.
4. Write a program to take a number and check if it is positive, negative, or zero.
5. Write a program to check if the number entered by the user is a Buzz number.
5 LOOP PROGRAMS (FOR / WHILE)
1. Write a program to display the sum of even numbers and product of odd numbers.
2. Write a program to print your name five times.
3. Write a program to print five consecutive numbers starting from one more than the given
input.
4. Write a program to print the factorial of a user-entered number.
5. Write a program to print the sum of digits of the user-entered number.
5 LIST PROGRAMS
1. Create a new list where each element is 1 greater than the corresponding element of L2 =
[2,4,6,8,10,12,14,16,18,20].
2. Create a list ['p','q','z','i','a'] and arrange it in descending order.
3. Input marks of three subjects in a list and print the percentage (each out of 100).
4. Print each element of ['P','Y','T','H','O','N'] along with positive and negative indexing.
5. Search for a specific value and display the number of occurrences in A =
[10,23,45,10,12,34,10,23].