Python Exercises
SOOPRO Pathshala provides Python Exercises
Day 1
Python Day 1
SOOPRO Pathshala Exercises
Day 1
1. Write a python program to print Soopro Pathshala.
2. Write a python program to print your full name.
Day 2
Python Day 2
SOOPRO Pathshala Exercises
Day 2
1. Calculate the multipilcation and sum of two given numbers?
2. Calculate the division and subtraction of two given numbers?
Day 3
Python Day 3
SOOPRO Pathshala Exercises
Day 3
1. Print the sum of the given current number and previous number
2. Print the multiplication of given current number and previous number
Day 4
Python Day 4
SOOPRO Pathshala Exercises
Day 4
1. Print total length of your first name.
2. Print total length of your full name.
Day 5
Python Day 5
SOOPRO Pathshala Exercises
Day 5
1. Print total length of your full name.
2. Print total length of your first name.
Day 6
Python Day 6
SOOPRO Pathshala Exercises
Day 6
1. Print first letter of your first name
2. Print first letter of your last name
Day 7
Python Day 7
SOOPRO Pathshala Exercises
Day 7
1. Print characters from a string that are present at an even index number.
2. Print characters from a string that are present at an odd index number.
Day 8
Python Day 8
SOOPRO Pathshala Exercises
Day 8
1. Remove first n characters from a string.
2. Remove last n characters from a string.
Day 9
Python Day 9
SOOPRO Pathshala Exercises
Day 9
1. Print concatenation of first name and last name by user input.
2. Print concatenation of first, last and middle name by user input.
Day 10
Python Day 10
SOOPRO Pathshala Exercises
Day 10
1. Check if the first and last number of a list is the same.
2. Display numbers divisible by 5 from a list.
Day 11
Python Day 11
SOOPRO Pathshala Exercises
Day 11
1. Write a python program to check even and odd number entered by user.
2. Write a python program to check positive and negative number entered by user.
Day 12
Python Day 12
SOOPRO Pathshala Exercises
Day 12
1. Create arithmetic operation in Python.
Day 13
Python Day 13
SOOPRO Pathshala Exercises
Day 13
1. Write a program to get a number from the user and print whether it is positive or negative.
2. Write a program that takes three numbers from the user and prints the greatest number.
3. Write a program that takes a number from the user and generates an integer between 1 and 7. It displays the weekday name.
4. Write a program that reads two floating-point numbers and tests whether they are the same up to three decimal places.
5. Write a program to find the number of days in a month.
6. Write a program that takes a year from the user and prints whether it is a leap year or not.
7. Write a program to check even or odd number.
8. Write a program to print valid to vote if age greater than or equal to 18 else print not valid to vote.
9. Write a program to print maximum among two integer numbers.
10. Write a program to print square of maximum and cube of minimum number.
11. Write a program to print diff of max and min among three numbers.
12. Write a program to print grade of student marks.
13. Write a program to print both are equal no, if two numbers are equal else print not equal.
14. Write a program to print 1 if two integer numbers are same, else print 0.
15. Write a program to print smallest among three numbers.
16. Write a program to print addition of two numbers on choice 1, subtraction of two numbers on choice 2, multiplication of two numbers on choice3 and division of two numbers on choice 4.
17. Write a program to print area of circle on choice 1, area of rectangle on choice 2, area of traingle on choice 3, invalid choice on choice 4.
18. Write a program to print sum of square and cube of any even number.
19. Write a program to print diff of square and cube of any odd number.
20. Write a program to print product of square and cube of even number
Day 14
Python Day 14
SOOPRO Pathshala Exercises
Day 14
1. Write a program to print 1 to 10 using for loop.
2. Write a program to print 10 to 1 using for loop.
3. Write a program to print 20 to 50 using for loop.
4. Write a program to print sum of 1 to 10 using for loop.
5. Write a program to print square of 1 to 10 using for loop.
6. Write a program to print cube of 1 to 10 using for loop.
7. Write a program to print even sum and odd sum of 1 to 10.
8. write a program to print table of any number using for loop.
9. Write a program to calculate the sum of first 10 natural number.
10. Write a program that prompts the user to input a positive integer. It should then print the multiplication table of that number.
11. Write a program to find the factorial value of any number entered through the keyboard.
12. Two numbers are entered through the keyboard. Write a program to find the value of one number raised to the power of another.
13. Write a program that prompts the user to input an integer and then outputs the number with the digits reversed. For example, if the input is 12345, the output should be 54321.
14. Write a program that reads a set of integers, and then prints the sum of the even and odd integers.
15. Write a program that prompts the user to input a positive integer. It should then output a message indicating whether the number is a prime number.
16. Write a program to calculate HCF of Two given number.
17. Write a do-while loop that asks the user to enter two numbers. The numbers should be added and the sum displayed. The loop should ask the user whether he or she wishes to perform the operation again. If so, the loop should repeat; otherwise it should terminate.
18. Write a program to enter the numbers till the user wants and at the end it should display the count of positive, negative and zeros entered.
19. Write a program to enter the numbers till the user wants and at the end the program should display the largest and smallest numbers entered.
20. Write a program to print out all Armstrong numbers between 1 and 500. If sum of cubes of each digit of the number is equal to the number itself, then the number is called an Armstrong number.
21. Write a program to print Fibonacci series of n terms where n is input by user :
22. Write a program to calculate the sum of following series where n is input by user. 1 + 1/2 + 1/3 + 1/4 + 1/5 +…………1/n
23. Write a program to print prime numbers between 2 to 50.
24. Write a program to print not prime numbers between 2 to 10.
25. Write a program to print your name ten times using while loop.
26. Write a program to print vowels and consonants of your first name.
27. Write a program to print vowels in left side and consonants in right side.
28. Write a program to print square of all odd numbers of 1 to 10.
29. Write a program to print cube of all even numbers of 1 to 10.
30. Write a program to print average of 1 to 10.
31. Write a program to print sum of table of any number.
32. Write a program to print sum of table of 1 to 5.
33. Write a program to print table of only even numbers between 5 to 20.
34. Write a program to print table of only odd numbers between 2 to 20.
35. Write a program to print total table sum between 1 to 10.
36. Write a program to print all even numbers between 2 to 50 in left side and all odd numbers in right side.
37. Write a program to print reverse of any three digit numbers.
38. Write a program to print sum of first and last number of any four digit numbers.
39. Write a program to print subtract of first and last number of any five digit numbers.
40. Write a program to print product of max and min of any four digit numbers.
41. Write a program to check whether given number is palindrome or not.
42. Write a program to check armstrong number.
43. Write a program to print table of max of and factorial of min of any five digit numbers.
44. Write a program to print sum of max and min and average of all three digit numbers.
45. Write a program to print following :
*
**
***
****
*****
46. Write a program to print table of any number in horizontal form.
47. Write a program to print square of all odd numbers in vertical form
48. Write a program to print factorial of 1 to 5.
49. Write a program to print factorial sum of all odd numbers between 1 to 10.
50. Write a program to print prime sum of odd even numbers between 5 to 50.
Day 15
Python Day 15
SOOPRO Pathshala Exercises
Day 15
1. Create integer list in python.
2. Create float list in python.
3. Create char list in python.
4. Create string list in python.
5. Create long list in python.
Day 16
Python Day 16
SOOPRO Pathshala Exercises
Day 16
1. Create integer list using function in python.
2. Create float list using function in python.
3. Create char list using function in python.
4. Create string list using function in python.
5. Create long list using function in python.
Day 17
Python Day 17
SOOPRO Pathshala Exercises
Day 17
1. Create integer list by user input using function in python.
2. Create float list by user input using function in python.
3. Create char list by user input using function in python.
4. Create string list by user input using function in python.
5. Create long list by user input using function in python.
Day 18
Python Day 18
SOOPRO Pathshala Exercises
Day 18
1. print square of even numbers of integer list using function.
2. print square of odd numbers of integer list using function.
3. print cube of even numbers of integer list using function.
4. print cube of odd numbers of integer list using function .
5. print table of integer list using function in python.
Day 19
Python Day 19
SOOPRO Pathshala Exercises
Day 19
1. print your name using no return with argument function in python.
2. print your name, age and roll no using no return with argument function in python.
3. print your date of birth using no return with argument function in python.
4. print your city name using return with no argument.
5. print your place of birth using return with argument.
Day 20
Python Day 20
SOOPRO Pathshala Exercises
Day 20
1. Print integer list in ascending order using no return with no argument function
2. print integer list in descending order usign no return with no argument function
3. print prime and not prime of integer list using no return with no argument function
4. print prime sum and not prime sum of integer list using no return with no argument function
5. print max of integer list using no return with no argument function
Day 21
Python Day 21
SOOPRO Pathshala Exercises
Day 21
1. Print simple interest using constructor in python.
2. Print area of rectangle using constructor in python.
3. Print area of traingle using constructor in python.
4. Print circumference of circle, area of circle and diameter of circle using constructor in python.
5. Print area of square and cube using constructor in python.
Day 22
Python Day 22
SOOPRO Pathshala Exercises
Day 22
1. Return area of circle to grand child in python.
2. Return sum of any table to child class in python.
3. Return evensum of list to grand child class in python.
4. Return oddsum of list to grand child class in python.
5. Return sum of each table from 1 to 5 to grand child in python.
Day 23
Python Day 23
SOOPRO Pathshala Exercises
Day 23
1. Print sum of two integer numbers, sum of two float numbers and sum of two double numbers using method overloading in python.
2. Print multiply of two integer numbers, multiply of two float numbers and multiply of two double numbers using method overloading in python. .
3. Print square of integer number, square of float number, square of double number using method overloading.
4. Print subtraction of two integer numbers, subtraction of two float numbers and subtraction of two double numbers using method overloading.
5. Print concatenation of two strings, concatenation of three strings and concatenation of four strings using python.
Day 24
Python Day 24
SOOPRO Pathshala Exercises
Day 24
1. Return area of circle to many child classes in python.
2. Return simple interest to many child classes in python.
3. Return Surface Area of Sphere to grand child in python.
4. Print Surface area of sphere using constructor in python
5. Print diff of area of circle and surface area of sphere using constructor in python.
Day 25
Python Day 25
SOOPRO Pathshala Exercises
Day 25
1. Return evesum of integer list to many classes in python.
2. Return surface area of sphere to many classes in python.
3. Return surface area of sphere to grand child in python.
4. Inherit two parent class in sub class in python.
5. Return string list to child class in python..
Day 26
Python Day 26
SOOPRO Pathshala Exercises
Day 26
1. Write a program to override area of circle by its child class method.
2. Write a program to override circumference of circle by its child class method.
3. Write a program to override diameter of circle by its child class method.
4. Write a program to override area of traingle by its child class method.
5. Write a program to override simple interest by its child class method.
Day 27
Python Day 27
SOOPRO Pathshala Exercises
Day 27
1. Write a program to overload perimeter of rectangle having different types of argument.
2. Write a program to print difference of area of sphere and circle using constructor in python.
3. Write a program to return maximum of three float numbers to many childs in python.
4. Write a program to return diff of maximum and minimum of three double numbers to grand child.
Day 28
Python Day 28
SOOPRO Pathshala Exercises
Day 28
1. Write a program to return vowels of your first name to grand child in python.
2. Write a program to return consonants of your first name to child class in python.
3. Write a program to return first two letters of your first name to many childs classes in python.
4. Write a program to return last two letters of your first name to many childs classes in python.
Day 29
Python Day 29
SOOPRO Pathshala Exercises
Day 29
1. Write a program to store all even numbers of list into even list and all odd numbers of list into oddlist, return sum of total evenlist and oddlist to grand child in python.
2. Write a program to store all prime numbers of list into prime list and all not prime numbers of list into not primelist, return sum of primelist to many childs classes in python.
3. Write a program to pass and print alternative numbers of list using class and object.
4. Write a program to pass and print all alternative prime numbers of list using class and object.
Day 30
Python Day 30
SOOPRO Pathshala Exercises
Day 30
1. Write a program to print all alternative vowels of your first name using no return with argument function.
2. Write a program to print all alternative consonants of your first name using no return with argument function.
3. Write a program to return reverse of area of traingle using no return with argument function.
4. Write a program to return reserse of area of circle using no return with argument function.
Day 31
Python Day 31
SOOPRO Pathshala Exercises
Day 31
1. Write a program to print area of circle using abstract method.
2. Write a program to print circum of circle using abstract method.
3. Write a program to print area of sphere using abstract method.
4. Write a program to print area of traingle using abstract method.
Day 32
Python Day 32
SOOPRO Pathshala Exercises
Day 32
1. Write a program to print diff of area of circle and area of traingle using interface.
2. Write a program to print sum of area of circle and area of traingle using interface.
3. Write a program to print area of rectangle using interface.
4. Write a program to print perimeter of rectangle using interface.
Day 33
Python Day 33
SOOPRO Pathshala Exercises
Day 33
1. Write a program to store all prime numbers of list in prime list using abstract method.
2. Write a program to store all not prime numbers of list in not prime list using abstract method.
3. Write a program to return area of sphere in child class using abstract method.
4. Write a program to return sum of area of sphere and area of circle using abstract method.
Day 34
Python Day 34
SOOPRO Pathshala Exercises
Day 34
1. Write a program to find frequency of numbers exist in list using abstract method.
2. Write a program to find duplicate numbers in list using abstract method.
3. Write a program to print concatenation of first letter and last letter of your name using abstract method.
4. Write a program to print maximum of list using abstract method.
Day 35
Python Day 35
SOOPRO Pathshala Exercises
Day 35
1. Write a program to print diff of maximum and minimum of integer list using abstract method.
2. Write a program to print sum of maximum and minimum of integer list using abstract method.
3. Write a program to print square of maximum number among three numbers using no return with argument method.
4. Write a program to print cube of minimum number among three numbers using no return with argument method.
Day 36
Python Day 36
SOOPRO Pathshala Exercises
Day 36
1. Write a program to check if number entered is palindrome or not(use abstract method).
2. Write a program to check if three digits number is an armstrong number or not.
3. Write a program to check leap year in python using abstract method inside interface.
4. Write a program to print fibonacci series using abstract method in python.
Day 37
Python Day 37
SOOPRO Pathshala Exercises
Day 37
1. Write a program to reverse and print tuple in python using abstract method .
2. Write a program to print all even numbers of tuple in python using abstract method.
3. Write a program to print all odd numbers of tuple in python using abstract method.
4. Write a program to print frequency of all letters exists in your first name.
Day 38
Python Day 38
SOOPRO Pathshala Exercises
Day 38
1. Write a program to return grade of student marks using single inheritance in python.
2. Write a program to return minimum of integer list using single inheritance in python.
3. Write a program to return concatenation of vowels of your first name to grand child.
4. Write a program to return total length of your first name to grand child.
Day 39
Python Day 39
SOOPRO Pathshala Exercises
Day 39
1. Write a program to print square of only prime numbers of tuple using concrete method.
2. Write a program to print cube of only not prime numbers of tuple using concrete method.
3. Write a program check even and odd on first choice, on second choice check prime or not prime, on third choice print table of any number and on fourth choice print simple interest.
4. Write a program to return diff of area of circle and circumference of circle to grand child.
Day 40
Python Day 40
SOOPRO Pathshala Exercises
Day 40
1. Write a program to initialize and print array using constructor in python.
2. Write a program to initialize and print tuple using constructor in python.
3. Write a program to initialize and print list using constructor in python.
4. Write a program to pass and concatenate first name, last name and middle name using constructor.
Day 41
Python Day 41
SOOPRO Pathshala Exercises
Day 41
1. Print the sum of the current number and the previous number using class and object in python.
2. Print characters from a string that are present at an even index number using class and object in python.
3. Remove first n characters from a string in python.
4. Check if the first and last number of a list is the same.
Day 42
Python Day 42
SOOPRO Pathshala Exercises
Day 42
1. Write a program to display numbers divisible by 5 from a list in python.
2. Write a program to return the count of a given substring from a string.
3. Remove first n characters from a string in python.
4. Write a Program to extract each digit from an integer in the reverse order.
Day 43
Python Day 43
SOOPRO Pathshala Exercises
Day 43
1. Calculate income tax for the given income by adhering to the rules below
First Rs 10,000 0%
Next Rs20,000 10%
The remaining 20%
2. Print multiplication table from 1 to 10.
3. Write a function called exponent(base, exp) that returns an int value of base raises to the power of exp.
4. Write a Python program to find out what version of Python you are using.
Day 44
Python Day 44
SOOPRO Pathshala Exercises
Day 44
1. Write a Python program to display the current date and time.
2. Write a Python program that accepts a sequence of comma-separated numbers from the user and generates a list and a tuple of those numbers.
Sample data : 2, 4, 6, 10
3. Write a Python program to print the volume of a sphere with radius six.
4. Write a Python program to calculate the difference between a given number and 17. If the number is greater than 17, return twice the absolute difference.
Day 45
Python Day 45
SOOPRO Pathshala Exercises
Day 45
1. Write a Python program to calculate the sum of three given numbers. If the values are equal, return three times their sum.
2. Write a Python program that determines whether a given number (accepted from the user) is even or odd, and prints an appropriate message to the user.
3. Write a Python program to count the number 4 in a given list.
4. Write a Python program to test whether a passed letter is a vowel or not.
Day 46
Python Day 46
SOOPRO Pathshala Exercises
Day 46
1. Write a Python program that calculates the area of a circle based on the radius entered by the user.
2. Write a Python program to calculate the sum of all items of a container (tuple, list, set, dictionary).
3. Write a Python program to get the ASCII value of a character.
4. Write a Python program to swap two variables.
Day 47
Python Day 47
SOOPRO Pathshala Exercises
Day 47
1. Write a Python program to determine the largest and smallest integers, longs, and floats.
2. Write a Python program to check whether multiple variables have the same value.
3. Write a Python program to check whether lowercase letters exist in a string.
4. Write a Python program to convert true to 1 and false to 0.
Day 48
Python Day 48
SOOPRO Pathshala Exercises
Day 48
1. Write a python program to print list of colors using abstract method.
2. Write a python program to print list of your fav foods using abstract method.
3. Write a python program to print list of your fav books using interface.
4. Write a python program to reverse your full name.
Day 49
Python Day 49
SOOPRO Pathshala Exercises
Day 49
1. Write a program to accept a number from a user and calculate the sum of all numbers from 1 to a given number.
2. Write a program to display all prime numbers within a range.
3. Write a python program to Display Fibonacci series up to 10 terms.
4. Write a python program to Find the factorial of a given number.
Day 50
Python Day 50
SOOPRO Pathshala Exercises
Day 50
1. Write a program to Calculate the cube of all numbers from 1 to a given number.
2. Write a program to create a function that takes two arguments, name and age, and print their value.
3. Create a function with variable length of arguments.
4. Write a python program to Create a recursive function.
Day 51
Python Day 51
SOOPRO Pathshala Exercises
Day 51
1. Generate a Python list of all the even numbers between 4 to 30.
2. Write a program to create a new string made of an input string’s first, middle, and last character.
3. Append new string in the middle of a given string
4. Arrange string characters such that lowercase letters should come first
Day 52
Python Day 52
SOOPRO Pathshala Exercises
Day 52
1. Count all letters, digits, and special symbols from a given string
2. Calculate the sum and average of the digits present in a string.
3. Reverse a given string.
4. Print your full name with # on the place of space.
Day 53
Python Day 53
SOOPRO Pathshala Exercises
Day 53
1. Write a python program to create text file in write mode.
2. Write a python program to create word file in write mode.
3. Write a python program to read text file.
4. Write a python program to truncate text file.
Day 54
Python Day 54
SOOPRO Pathshala Exercises
Day 54
1. Write a python program to read first 10 characters from text file.
2. Write a python program to read first 20 characters from text file.
3. Write a python program to count total words in text file.
4. Write a python program to count total chars in text file.
Day 55
Python Day 55
SOOPRO Pathshala Exercises
Day 55
1. Create menu driven program in python press 1 to create file in write mode, press 2 to read file, press 3 to truncate file, press 4 to delete file and press 5 to delete folder
2. Create a python program to count total files in specified folder.
3. Write a python program to create folder.
4. Write a python program to create sub folder.
5. Create menu driven program in python, press 1 to delete all files of current directory, press 2 to delete subfolder, press 3 to delete current folder
Day 56
Python Day 56
SOOPRO Pathshala Exercises
Day 56
1. Create a GUI application to print information on title bar.
2. Create a GUI application to print information on label
3. Create a GUI application to print information on label on button click
4. Create a GUI application to print value of textbox on label control on button click in python
5. Create a GUI application to print square of any number by user input.
Day 57
Python Day 57
SOOPRO Pathshala Exercises
Day 57
1. Create a GUI application to print addition of two numbers.
2. Create a GUI application to print subtraction of two numbers.
3. Create a GUI application to print multiplication of two numbers.
4. Create a GUI application to print division of two numbers.
5. Create a GUI application to print remainder of two numbers.
Day 58
Python Day 58
SOOPRO Pathshala Exercises
Day 58
1. Create a GUI application to print maximum of two numbers by user input.
2. Create a GUI application to print maximum of three numbers by user input.
3. Create a GUI application to print cm of meter by user input.
4. Create a GUI application to print meter of cm by user input.
5. Create a GUI application to print inch of feet by user input.
Day 59
Python Day 59
SOOPRO Pathshala Exercises
Day 59
1. Create a GUI application to concatenate your first and last name.
2. Create a GUI application to print reverse of your first name by user input.
3. Create a GUI application to print total length of your first name by user input.
4. Create a GUI application to print total vowls .
5. Create a GUI application to print inch of feet by user input.
Day 60
Python Day 60
SOOPRO Pathshala Exercises
Day 60
1. Create a GUI application to check prime or not prime number by user input.
2. Create a GUI application to check even or odd number by user input.
3. Create a GUI application to print factorial of any number.
4. Create a GUI application to print square of maximum and cube of minimum among two numbers.
5. Create a GUI application to print sum of max and min of three numbers.
Day 61
Python Day 61
SOOPRO Pathshala Exercises
Day 61
1. Create a simple Login form using GUI application.
2. Create a registration form using GUI application.
3. Create a login form in GUI with database.
4. Create a GUI application to accept user input, try to save input in database.
5. Create a GUI application to accept first name and last name by user input, try to store information into database.
Day 62
Python Day 62
SOOPRO Pathshala Exercises
Day 62
1. Create a GUI application to accept and store Id, name, gender, city and salary into database.
2. Create a GUI application to accept id, name and age into database.
3. Create a GUI application to accept id, name, gender and mobile into database.
4. Create a details form using GUI application.