Challenge: Running Grocery Store Extended
Swipe to start coding
You are a trader analyzing your recent budget changes to determine whether you've made a profit, incurred a loss, or maintained your original budget. You have an initial_budget
representing your starting amount, a variable called changes
representing any gains or losses to your budget, and a variable called final_budget
representing your ending budget after applying these changes.
- If your final budget is greater than your initial budget, assign
"success"
toresult
. - If your final budget is less than your initial budget, assign
"failure"
toresult
. - if your budget has remained the same, assign
"budget unchanged"
toresult
.
Løsning
Tak for dine kommentarer!
single
Spørg AI
Spørg AI
Spørg om hvad som helst eller prøv et af de foreslåede spørgsmål for at starte vores chat
Opsummér dette kapitel
Explain code
Explain why doesn't solve task
Awesome!
Completion rate improved to 1.67
Challenge: Running Grocery Store Extended
Stryg for at vise menuen
Swipe to start coding
You are a trader analyzing your recent budget changes to determine whether you've made a profit, incurred a loss, or maintained your original budget. You have an initial_budget
representing your starting amount, a variable called changes
representing any gains or losses to your budget, and a variable called final_budget
representing your ending budget after applying these changes.
- If your final budget is greater than your initial budget, assign
"success"
toresult
. - If your final budget is less than your initial budget, assign
"failure"
toresult
. - if your budget has remained the same, assign
"budget unchanged"
toresult
.
Løsning
Tak for dine kommentarer!
Awesome!
Completion rate improved to 1.67single