Python Arithmetic Operators Practice Questions (45 Total)
1. Write a Python program to add two numbers entered by the user.
2. Write a Python program to subtract two numbers entered by the user.
3. Write a Python program to multiply two numbers entered by the user.
4. Write a Python program to divide two numbers entered by the user.
5. Write a Python program to calculate the remainder using modulo operator.
6. Write a Python program to calculate the square of a number.
7. Write a Python program to calculate the cube of a number.
8. Write a Python program to increment a number by 1.
9. Write a Python program to decrement a number by 1.
10. Write a Python program to swap two numbers using a temporary variable.
11. Write a Python program to swap two numbers without using a temporary variable.
12. Write a Python program to calculate the area of a rectangle.
13. Write a Python program to calculate the area of a triangle.
14. Write a Python program to calculate the average of three numbers.
15. Write a Python program to check if a number is even or odd.
16. Write a Python program to convert minutes to hours and minutes using division and modulo.
17. Write a Python program to calculate compound interest.
18. Write a Python program to calculate the percentage of marks from total marks.
19. Write a Python program to convert Celsius to Fahrenheit.
20. Write a Python program to convert Fahrenheit to Celsius.
21. Write a Python program to calculate the perimeter of a circle.
22. Write a Python program to calculate the perimeter of a rectangle.
23. Write a Python program to find the maximum of three numbers using arithmetic and logical
operators.
24. Write a Python program to solve a quadratic equation.
25. Write a Python program to check if a year is a leap year using arithmetic operators.
26. Write a Python program to calculate the sum of the first n natural numbers.
27. Write a Python program to calculate the sum of the squares of first n natural numbers.
28. Write a Python program to calculate the sum of the cubes of first n natural numbers.
29. Write a Python program to find the sum of digits of a number using arithmetic operators.
30. Write a Python program to reverse a number using arithmetic operators.
31. Write a Python program to check if a number is a palindrome using arithmetic operators.
32. Write a Python program to check if a number is an Armstrong number.
33. Write a Python program to calculate the factorial of a number using arithmetic operators.
34. Write a Python program to calculate the greatest common divisor (GCD) of two numbers.
35. Write a Python program to calculate the least common multiple (LCM) of two numbers.
36. Write a Python program to find the power of a number without using the built-in power operator.
37. Write a Python program to convert a binary number to decimal using arithmetic.
38. Write a Python program to convert a decimal number to binary using arithmetic.
39. Write a Python program to find all prime numbers up to a given number using arithmetic
operations.
40. Write a Python program to generate Fibonacci numbers up to n using arithmetic.
41. Write a Python program to calculate the sum of a geometric progression.
42. Write a Python program to calculate the product of a series of numbers.
43. Write a Python program to evaluate a complex arithmetic expression entered by the user.
44. Write a Python program to simulate a simple calculator (addition, subtraction, multiplication,
division).
45. Write a Python program to solve simultaneous equations using arithmetic operators.