Chapter Practice Arena
All ChaptersPython Foundations Problems
Targeted practice challenges specifically curated for this chapter. Inspect hints, verify outputs, and check Pythonic solutions.
Difficulty:
Chapter:
Showing 6 challenges · 13 total · Page 1 of 3
Write a program that displays the result of 12 + 8 on the first line and the result of 12 * 8 on the second line. Do not hardcode the answers.
Starter Code
# Write your solution below
Expected Output:20
96
Write a Python program that calculates the product of 6 and 7 and displays the result. Do not hard-code the output as a string.
Starter Code
# Calculate and display the product
Expected Output:42
In your operating-system terminal, run the Python version command appropriate for your installation. Record the command that worked and the version it reported. This is a hands-on setup exercise rather than a Python coding exercise.
Starter Code
# Terminal command examples: # Windows: py --version # Other possible command: python --version # macOS/Linux: python3 --version
Expected Output:A version line such as Python 3.x.y. The digits depend on the installed release.
Assign the integer 100 to a variable named value and print it. Then assign the string 'CodeNivo' to the same variable and print it again. The output must contain two lines.
Starter Code
# Assign and print two different values
Expected Output:100
CodeNivo
Write a program that displays the following two lines exactly: Welcome to Python! and I am learning with CodeNivo.
Starter Code
# Write your solution below
Expected Output:Welcome to Python!
I am learning with CodeNivo.
Print the values 2026, 10, and 11 on one line, separated by hyphens. Your output must be exactly 2026-10-11.
Starter Code
# Write your solution below
Expected Output:2026-10-11