Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Oppiskele Bringing Python Fundamentals Together | First Acquaintance with Python
Introduction to Python (dev copy)

Pyyhkäise näyttääksesi valikon

book
Bringing Python Fundamentals Together

Tehtävä

Swipe to start coding

  1. Print a title "Shopping Receipt" and a divider line (using -) with print().
  2. Print the price for the first item:
    • It is priced per weight at $162 per unit.
    • The customer bought 1.2 of it.
    • Calculate and print the total price for this item.
  3. Print the price for the second item:
    • Originally $25, but comes with a discount of $3.
    • Calculate and print the final price after the discount.
  4. Print the subtotal and tax (8%) using print().
Shopping Receipt
------------------------
Item 1: $194.4
Item 2: $22
------------------------
Subtotal: $216.4
Tax (8%): $21.64
------------------------
Thank you for shopping!

Ratkaisu

Switch to desktopVaihda työpöytään todellista harjoitusta vartenJatka siitä, missä olet käyttämällä jotakin alla olevista vaihtoehdoista
Oliko kaikki selvää?

Miten voimme parantaa sitä?

Kiitos palautteestasi!

Osio 1. Luku 5
single

single

Kysy tekoälyä

expand

Kysy tekoälyä

ChatGPT

Kysy mitä tahansa tai kokeile jotakin ehdotetuista kysymyksistä aloittaaksesi keskustelumme

close

Awesome!

Completion rate improved to 1.64

book
Bringing Python Fundamentals Together

Tehtävä

Swipe to start coding

  1. Print a title "Shopping Receipt" and a divider line (using -) with print().
  2. Print the price for the first item:
    • It is priced per weight at $162 per unit.
    • The customer bought 1.2 of it.
    • Calculate and print the total price for this item.
  3. Print the price for the second item:
    • Originally $25, but comes with a discount of $3.
    • Calculate and print the final price after the discount.
  4. Print the subtotal and tax (8%) using print().
Shopping Receipt
------------------------
Item 1: $194.4
Item 2: $22
------------------------
Subtotal: $216.4
Tax (8%): $21.64
------------------------
Thank you for shopping!

Ratkaisu

Switch to desktopVaihda työpöytään todellista harjoitusta vartenJatka siitä, missä olet käyttämällä jotakin alla olevista vaihtoehdoista
Oliko kaikki selvää?

Miten voimme parantaa sitä?

Kiitos palautteestasi!

close

Awesome!

Completion rate improved to 1.64

Pyyhkäise näyttääksesi valikon

some-alt