give me some questions based on python
programming for athematic operators so that I can
write a program
Of course. Here are some questions based on Python's arithmetic operators that you can use to
practice writing programs. They range from basic to slightly more complex problems.
Basic Arithmetic Operator Questions
1. Addition (+)
Write a program that takes two numbers as input from the user and prints their sum.
2. Subtraction (-)
Create a program that calculates the age of a person by taking their birth year and the
current year as input.
3. Multiplication (*)
Write a program to calculate the area of a rectangle. Ask the user for the length and
width.
4. Division (/)
Create a program that calculates how many miles per gallon a car gets. Ask the user for
the number of miles driven and the gallons of fuel used. Note that the result may be a
decimal number.
Questions on Division, Modulus, and Exponents
5. Floor Division (//)
Imagine you have a total number of sweets and you want to distribute them equally
among a certain number of people. Write a program that asks for the total sweets and
the number of people, and then calculates how many sweets each person gets,
discarding any fractional part.
6. Modulus (%)
Following the previous problem, write a program to find out how many sweets are left
over after distributing them equally.
7. Exponentiation (**)
Write a program that calculates the power of a number. Ask the user for a base number
and an exponent, and compute the result (e.g., baseexponent).
Combined and Scenario-Based Questions
8. Order of Operations
Write a program that solves the expression: a * (b + c) / d. Ask the user to input the
values for a, b, c, and d.
9. Simple Interest Calculator
Create a program to calculate simple interest. The formula is (P * R * T) / 100, where P
is the principal amount, R is the rate of interest, and T is the time in years. Ask the user
for all three values.
10. Temperature Conversion
Write a program to convert temperature from Celsius to Fahrenheit. The formula is
(Celsius * 9/5) + 32. Ask the user for the temperature in Celsius.
These questions should give you a good foundation for practicing with Python's arithmetic
operators. Good luck