Python Problems
Python Problems
Python Problems
1. Arithmetic operations:
o Write a program that takes two numbers as input from the user and prints all
arithmetic operations.
2. Square of a Number:
o Write a program that takes a number as input from the user and prints the square of
that number.
o Write a program that takes a number as input and checks whether it is even or odd.
6. Find the Largest of Three Numbers and sum of Largest and Smallest numbers:
o Write a program that takes three numbers as input from the user and prints the
largest of the three then print the sum of largest and smallest numbers
o Write a program to calculate the area of a circle given its radius. The formula is ( \
text{Area} = \pi \times r^2 ).
o Write a program to calculate the perimeter of a rectangle given its length and width.
The formula is ( \text{Perimeter} = 2 \times (length + width) ).
o Write a program to find the greatest common divisor (GCD) of two numbers.
Above Basics Problem (By defining atleast one function)
1. Factorial calculation
2. Leap Year check
3. Count number of digits in a number
4. Sum and product of digits of a number
5. Number to number name (0 to 99)
6. Reverse of a number
7. Sum of even numbers till given number
8. Quadratic equation roots
9. Check for palindrome
10. Check for Armstrong number
11. LCM calculation of two numbers
12. Decimal Number to Binary Number