Intermediate Level Python Problems
with Sample Input/Output
Task A
Write a Python program that prints your name in reverse order, character by character,
each on a new line.
Sample Input:
John
Sample Output:
n
h
o
J
Task B
Without using variables, write a Python program that subtracts 125 from 200 and prints the
result.
Sample Input:
Sample Output:
75
Task C
Assign the values 'Winter' and 2025 to variables `season` and `year`, respectively, and print
them in one line separated by a dash.
Sample Input:
Sample Output:
Winter-2025
Task D
Read a user's name and print: 'Welcome, [Name]!' with the name input by the user.
Sample Input:
Alice
Sample Output:
Welcome, Alice!
Task E
Write a program that reads two integers M and N, computes M^N, and also prints whether
the result is even or odd.
Sample Input:
2
3
Sample Output:
2^3 = 8
Even
Task F
A four-legged table can only stand if the total number of items is divisible by 4. Write a
program to read a number and print the maximum divisible load, along with how many
items will be left over.
Sample Input:
11
Sample Output:
Maximum load: 8
Remaining items: 3
Task G
Read three integers A, B, C and a float D, then compute and print the result using the
formula: (A + B * C - D) // 2, as an integer.
Sample Input:
2
3
4
1.0
Sample Output:
6
Task H
Read an integer for total candies. Distribute equally among 4 kids, and print how many each
kid gets and how many are left for the parent.
Sample Input:
18
Sample Output:
Each kid gets 4 candies
Parent gets 2 candies
Task I
Read two inputs and print the one with more characters first, followed by the other.
Sample Input:
Python
AI
Sample Output:
PythonAI
Task J
Take an integer, a float, and a string. Add the int and float, then concatenate the string to the
result and print.
Sample Input:
5
2.5
Hello
Sample Output:
The result is 7.5Hello
Task K
Read an integer and print 'Even' if even, 'Odd' if odd, and 'Zero' if the input is 0.
Sample Input:
0
Sample Output:
Zero