Expressions and Data Types Python practice problems
Integers, floats, strings, booleans, arithmetic, comparisons, and operator precedence.
Core concepts
Problem-solving patterns
- integers · arithmetic
- operators · formatting
- float · geometry
- formula · float
- type conversion · money
What this topic builds
Learn the idea once, use it across the exercises, and explain why your approach works.
All 15 problems in this topic
Work from top to bottom to build the concept gradually.
- #006Add two integers: Handle a negative adjustmentStarterPremium
A ledger combines a credit and a negative correction.
- #007Show basic arithmetic: Compare two measurementsStarterPremium
A lab assistant needs the four basic results for two readings.
- #008Show basic arithmetic: Use a negative first valueStarterPremium
Test how arithmetic behaves when the first reading is below zero.
- #009Rectangle measurements: Floor matStarterPremium
Calculate material area and border length for a rectangular floor mat.
- #010Rectangle measurements: Decimal dimensionsStarterPremium
Calculate a poster whose measurements include decimals.
- #011Convert Celsius to Fahrenheit: Weather displayStarterPremium
Convert a pleasant daytime temperature for an international weather display.
- #012Convert Celsius to Fahrenheit: Freezing referenceStarterPremium
Verify the conversion at the freezing point of water.
- #013Calculate a purchase total: Notebook orderStarterPremium
Find the cost of several notebooks sold at one unit price.
- #014Calculate a purchase total: Single premium itemBeginnerPremium
Calculate a one-item order while keeping two currency decimals.
- #015Convert seconds to clock time: Video durationBeginnerPremium
Display a video duration in hours, minutes, and seconds.
- #016Convert seconds to clock time: Short timerBeginnerPremium
Format a duration shorter than one minute with leading zeros.
- #017Swap two values: Swap seat labelsBeginnerPremium
A seating tool accidentally receives two labels in reverse order and must swap them.
- #018Swap two values: Swap signed readingsBeginnerPremium
Exchange two signed readings while keeping them as text tokens.
- #019Average three scores: Quiz averageBeginnerPremium
A student wants the mean of three quiz scores.
- #020Average three scores: Scores with decimalsBeginnerPremium
A trainer records assessment scores that include half points.