Course Content
Introduction to Python
Introduction to Python
Challenge: Running a Grocery Store
Suppose you run a small grocery store with daily expenses of $2000. If your daily revenue is less than $2000, you're operating at a loss; otherwise, you're turning a profit. Let's craft an if
/else
statement to reflect this situation.
Swipe to start coding
You are given the variable is_business_successful
. It should change dynamically based on the value of revenue
.
- If
revenue
is greater than or equal to 2000, assign the valueTrue
to the variable. - If
revenue
is strictly less than 2000, assign the valueFalse
to the variable. - Use an
if-else
statement to solve this task.
Solution
Thanks for your feedback!
Challenge: Running a Grocery Store
Suppose you run a small grocery store with daily expenses of $2000. If your daily revenue is less than $2000, you're operating at a loss; otherwise, you're turning a profit. Let's craft an if
/else
statement to reflect this situation.
Swipe to start coding
You are given the variable is_business_successful
. It should change dynamically based on the value of revenue
.
- If
revenue
is greater than or equal to 2000, assign the valueTrue
to the variable. - If
revenue
is strictly less than 2000, assign the valueFalse
to the variable. - Use an
if-else
statement to solve this task.
Solution
Thanks for your feedback!