pyPython Practice LabFrom first print to final round
TOPIC 02 OF 18

Expressions and Data Types Python practice problems

Integers, floats, strings, booleans, arithmetic, comparisons, and operator precedence.

15 exercises8+ conceptsBeginner → interview context
Start this topic
WHAT YOU WILL PRACTISE

Core concepts

Add two integersShow basic arithmeticRectangle measurementsConvert Celsius to FahrenheitCalculate a purchase totalConvert seconds to clock timeSwap two valuesAverage three scores
REUSABLE THINKING

Problem-solving patterns

  • integers · arithmetic
  • operators · formatting
  • float · geometry
  • formula · float
  • type conversion · money
PRACTICE OUTCOME

What this topic builds

Learn the idea once, use it across the exercises, and explain why your approach works.

ORDERED PRACTICE

All 15 problems in this topic

Work from top to bottom to build the concept gradually.

  1. #006
    Add two integers: Handle a negative adjustment

    A ledger combines a credit and a negative correction.

    StarterPremium
  2. #007
    Show basic arithmetic: Compare two measurements

    A lab assistant needs the four basic results for two readings.

    StarterPremium
  3. #008
    Show basic arithmetic: Use a negative first value

    Test how arithmetic behaves when the first reading is below zero.

    StarterPremium
  4. #009
    Rectangle measurements: Floor mat

    Calculate material area and border length for a rectangular floor mat.

    StarterPremium
  5. #010
    Rectangle measurements: Decimal dimensions

    Calculate a poster whose measurements include decimals.

    StarterPremium
  6. #011
    Convert Celsius to Fahrenheit: Weather display

    Convert a pleasant daytime temperature for an international weather display.

    StarterPremium
  7. #012
    Convert Celsius to Fahrenheit: Freezing reference

    Verify the conversion at the freezing point of water.

    StarterPremium
  8. #013
    Calculate a purchase total: Notebook order

    Find the cost of several notebooks sold at one unit price.

    StarterPremium
  9. #014
    Calculate a purchase total: Single premium item

    Calculate a one-item order while keeping two currency decimals.

    BeginnerPremium
  10. #015
    Convert seconds to clock time: Video duration

    Display a video duration in hours, minutes, and seconds.

    BeginnerPremium
  11. #016
    Convert seconds to clock time: Short timer

    Format a duration shorter than one minute with leading zeros.

    BeginnerPremium
  12. #017
    Swap two values: Swap seat labels

    A seating tool accidentally receives two labels in reverse order and must swap them.

    BeginnerPremium
  13. #018
    Swap two values: Swap signed readings

    Exchange two signed readings while keeping them as text tokens.

    BeginnerPremium
  14. #019
    Average three scores: Quiz average

    A student wants the mean of three quiz scores.

    BeginnerPremium
  15. #020
    Average three scores: Scores with decimals

    A trainer records assessment scores that include half points.

    BeginnerPremium