Python Practice Questions (Intermediate Level)
Question 1 – Temperature Converter Question 6 – Leap Year Checker
Write a program that takes a temperature in Ask the user to enter a year and print whether
Celsius from the user and converts it to it’s a leap year or not.
Fahrenheit. A year is leap if it’s divisible by 4 and (not
Formula: F = (C * 9/5) + 32 divisible by 100 or divisible by 400).
Question 2 – Simple Calculator Question 7 – Average Calculator
Ask the user to enter two numbers and an Ask the user to enter three test scores.
operator (+, -, *, /). Calculate and print the average, and then print
Use if statements to perform the correct "Passed" if the average ≥ 60, otherwise "Failed".
operation and print the result. Question 8 – Login Simulation
Question 3 – Number Comparison Create two variables:
Ask the user to enter three numbers and print username = "admin"
password = "1234"
the largest one.
Ask the user to input both values.
Hint: Use nested if or multiple comparisons.
If they match, print "Access granted", otherwise
Question 4 – Even or Multiple of 3
"Access denied".
Ask the user for a number.
Question 9 – Odd or Even Sum
If the number is even and divisible by 3, print
Ask the user to input two numbers.
"Even and multiple of 3".
Find their sum and print whether the sum is odd
If it’s only even, print "Even".
or even.
If it’s only divisible by 3, print "Multiple of 3".
Question 10 – Quadratic Expression
Otherwise, print "Neither".
Ask the user for a number x, then calculate the
Question 5 – Grading System
result of:
Ask the user for a score (0–100).
y=3x2−4x+7y = 3x^2 - 4x + 7y=3x2−4x+7
Print:
and print the value of y.
• "A" if score ≥ 90
• "B" if 80–89
• "C" if 70–79
• "D" if 60–69
• "F" otherwise
Use if–elif–else.