Python practice: Arithmetic & Mathematical Operations

Chapter 3 · 8 questions · free to solve

  1. Question 1 · easy

    Basic four arithmetic operations

    Given a = 20 and b = 4, print their sum, difference (a - b), product (a * b), and quotient (a / b) on separate lines:

    Solve it in your browser
  2. Question 2 · easy

    Floor division for packaging

    An order contains 53 units. Shipping cartons hold 12 units each. Use // to compute how many full cartons can be packed and print the result:

    Solve it in your browser
  3. Question 3 · easy

    Modulo for leftover inventory

    Using units = 53 and carton_size = 12, calculate the remaining units that do not fill a complete carton using % and print the result:

    Solve it in your browser
  4. Question 4 · easy

    Compound annual return with **

    Calculate future value: principal = 1000, rate = 1.10, years = 3. Multiply principal * (rate ** years) and print the result:

    Solve it in your browser
  5. Question 5 · easy

    Parentheses control precedence

    Print the result of (10 + 20) * 2 on line 1, and 10 + 20 * 2 on line 2 to show precedence difference:

    Solve it in your browser
  6. Question 6 · easy

    Round decimal prices

    Given price = 49.9567, round it to 2 decimal places using round() and print the rounded result:

    Solve it in your browser
  7. Question 7 · easy

    Average basket size

    Three store branches made sales: store_a = 120, store_b = 150, store_c = 180. Compute the average sales and print it:

    Solve it in your browser
  8. Question 8 · medium

    Discount percentage calculation

    Given list_price = 2500 and sale_price = 2000, compute discount_pct = (list_price - sale_price) / list_price. Print discount_pct:

    Solve it in your browser

These questions are free.

Make a free account to solve them, with instant checking and an AI tutor for hints.

Start free