Challenge: Working with Comparison Operators
Swipe to start coding
You are planning a shopping trip and need to compare the costs of three different fruits to make the best purchasing decision. You want to know if two of the fruits have the same cost and whether buying two fruits together is cheaper than buying another combination.
- Check whether the cost of apples is the same as the cost of bananas, and store the result in a variable called
is_same_price
. - Check whether the total cost of apples and oranges is less than the total cost of oranges and bananas, and store the result in a variable called
is_cheaper_combination
.
Ratkaisu
Kiitos palautteestasi!
single
Kysy tekoälyä
Kysy tekoälyä
Kysy mitä tahansa tai kokeile jotakin ehdotetuista kysymyksistä aloittaaksesi keskustelumme
Awesome!
Completion rate improved to 1.67
Challenge: Working with Comparison Operators
Pyyhkäise näyttääksesi valikon
Swipe to start coding
You are planning a shopping trip and need to compare the costs of three different fruits to make the best purchasing decision. You want to know if two of the fruits have the same cost and whether buying two fruits together is cheaper than buying another combination.
- Check whether the cost of apples is the same as the cost of bananas, and store the result in a variable called
is_same_price
. - Check whether the total cost of apples and oranges is less than the total cost of oranges and bananas, and store the result in a variable called
is_cheaper_combination
.
Ratkaisu
Kiitos palautteestasi!
Awesome!
Completion rate improved to 1.67single