0% found this document useful (0 votes)
3 views

{PRACTICE PROBLEMS} Python Programming

The document outlines a series of programming tasks that involve basic arithmetic operations, grading systems, and number checks using conditional statements and the MOD operator. It includes programs for calculating sums, differences, products, and quotients, as well as determining grades based on exam scores. Additionally, it covers tasks such as checking for even or odd numbers, divisibility rules, temperature conversions, and leap year verification.

Uploaded by

Hasin Eshrak
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

{PRACTICE PROBLEMS} Python Programming

The document outlines a series of programming tasks that involve basic arithmetic operations, grading systems, and number checks using conditional statements and the MOD operator. It includes programs for calculating sums, differences, products, and quotients, as well as determining grades based on exam scores. Additionally, it covers tasks such as checking for even or odd numbers, divisibility rules, temperature conversions, and leap year verification.

Uploaded by

Hasin Eshrak
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

1.

Arithmetic Operations
Question: Write a program that asks the user to input two numbers and then calculates
and displays:
• The sum of the two numbers
• The difference (first number - second number)
• The product
• The quotient (first number divided by second number)
• The remainder when the first number is divided by the second number

2. IF/ELIF/ELSE - Grading System


Question: Write a program that asks the user to enter their exam score (0-100) and assigns
a grade based on the following criteria:
• 90 and above: Grade A
• 80 to 89: Grade B
• 70 to 79: Grade C
• 60 to 69: Grade D
• Below 60: Grade F

3. MOD Operator - Even or Odd


Question: Write a program that takes an integer input from the user and determines
whether the number is even or odd using the MOD operator.

4. Number Divisibility Using MOD and IF/ELSE


Question: Write a program that asks the user for a number and checks:
• If the number is divisible by both 3 and 5, print "FizzBuzz".
• If the number is only divisible by 3, print "Fizz".
• If the number is only divisible by 5, print "Buzz".
• If the number is not divisible by either, print the number itself.

5. Simple Calculator- Question: Write a program that asks the user to enter two
numbers and an arithmetic operation (+, -, *, /, %). Perform the corresponding
operation and display the result.
6. Largest of Three Numbers - Question: Write a program that takes three numbers as
input and determines which one is the largest.

7. Temperature Converter (Celsius to Fahrenheit and Vice


Versa) - Question: Write a program that asks the user to
choose conversion type:
• Enter 1 to convert from Celsius to Fahrenheit.
• Enter 2 to convert from Fahrenheit to Celsius.
Then, take the temperature as input and perform the conversion.
Use the formulas:
Celsius to Fahrenheit: F = (C × 9/5) + 32
Fahrenheit to Celsius: C = (F - 32) × 5/9

8. Leap Year Checker (Using MOD) - Question: Write a program that asks the user to
enter a year and checks if it's a leap year using the following conditions:
• A year is a leap year if it is divisible by 4.
• However, if the year is divisible by 100, it is not a leap year.
• But if the year is also divisible by 400, it is a leap year.

You might also like