File tree Expand file tree Collapse file tree 5 files changed +10
-9
lines changed Expand file tree Collapse file tree 5 files changed +10
-9
lines changed Original file line number Diff line number Diff line change 11# Decisions 1
22# Write in Python syntax what you would say
3- # if you wanted either a 5 dollars OR (2 drinks AND 1 snack).
3+ # if you wanted either 5 dollars OR (2 drinks AND 1 snack).
44
55# write your code here
Original file line number Diff line number Diff line change 77But if the customer enters 'french toast'
88AND 'coffee', there is a discount of $1.
99
10- And if the customer enters 'chicken soup' OR 'apple juice',
10+ Otherwise, if the customer enters 'chicken soup' OR 'apple juice',
1111the price increases by $1.
1212
1313Write a program that takes an order from a user
Original file line number Diff line number Diff line change 11"""
2- Here is a block of code where one tries do determine
3- if somone is a nobel prize winner.
2+ Simplify
3+ Here is a block of code where one tries to determine
4+ if someone is a Nobel Prize winner.
45
56Rewrite the code to work in one statement.
67
Original file line number Diff line number Diff line change 77But if the customer enters 'french toast'
88AND 'coffee', there is a discount of $1.
99
10- And if the customer enters 'chicken soup' OR 'apple juice',
10+ Otherwise, if the customer enters 'chicken soup' OR 'apple juice',
1111the price increases by $1.
1212
1313Write a program that takes an order from a user
2626# discount of $1 if the user orders french toast and coffee
2727if food == 'french toast' and drink == 'coffee' :
2828 total_cost -= 1
29-
3029# charge extra $1 if user orders chicken soup or apple juice
31- if food == 'chicken soup' or drink == 'apple juice' :
30+ elif food == 'chicken soup' or drink == 'apple juice' :
3231 total_cost += 1
3332
3433# display total
Original file line number Diff line number Diff line change 11"""
2- Here is a block of code where one tries do determine
3- if somone is a nobel prize winner.
2+ Simplify
3+ Here is a block of code where one tries to determine
4+ if someone is a Nobel Prize winner.
45
56Rewrite the code to work in one statement.
67
You can’t perform that action at this time.
0 commit comments