How to Work with Variables in Python
Imagine you got the cost of an item saved in the price variable and you want to apply a 15% discount. You can simply reassign the updated value like this:
1234567# Initial price price = 50 # Applying the discount price = price * (1 - 0.15) print(price)
Compito
Swipe to start coding
- A teacher is dividing
47students into groups of6. Your task is to determine how many students will not fit into a complete group and store this remainder in thestudentsvariable.
Soluzione
Tutto è chiaro?
Grazie per i tuoi commenti!
Sezione 2. Capitolo 3
single
Chieda ad AI
Chieda ad AI
Chieda pure quello che desidera o provi una delle domande suggerite per iniziare la nostra conversazione
Suggested prompts:
Riassuma questo capitolo
Explain code
Explain why doesn't solve task
Fantastico!
Completion tasso migliorato a 1.64
How to Work with Variables in Python
Scorri per mostrare il menu
Imagine you got the cost of an item saved in the price variable and you want to apply a 15% discount. You can simply reassign the updated value like this:
1234567# Initial price price = 50 # Applying the discount price = price * (1 - 0.15) print(price)
Compito
Swipe to start coding
- A teacher is dividing
47students into groups of6. Your task is to determine how many students will not fit into a complete group and store this remainder in thestudentsvariable.
Soluzione
Tutto è chiaro?
Grazie per i tuoi commenti!
Sezione 2. Capitolo 3
single