Question: Written in Python: The bakery shop sells 3 types of pies. Apple pies cost $ 3 each Cherry pies cost $ 4 each Peach pies

Written in Python:
The bakery shop sells 3 types of pies.
Apple pies cost $3 each
Cherry pies cost $4 each
Peach pies cost $2 each
And this is how many they sold in 4 days:
For example, the value of sales for Monday is calculated this way:
Apple pie value + Cherry pie value + Peach pie value
$3xx13+$4xx8+$2xx6=$83
And for Tuesday: $39+ $47+ $24= $63
And for Wednesday: $3xx7+$4xx4+$2xx0=$37
And for Thursday: $3xx15+$4xx6+$2xx3=$75
You need to have two lists:
one one-dimensional and
Define matrix price as a one-dimensional array
price =[3,4,2] # one-dimensional list, unit in $ for Apple, Cherry, and
Peach pie
one two-dimensional
Define matrix pie (3x4), each column represents a day, Monday-Thursday
pie =[
[13,9,7,15], # 1st row for Apple
[8,7,4,6], # 2nd row for Cherry
[6,4,0,3] # 3rd row for Peach
]
As shown above, you may call the one-dimensional list price and the two-dimensional list pie.
The final result/output can be in a form list such as
[83,63,37,75]
Or
Mon Tue Wed Thu
$83 $63 $37 $75
Written in Python: The bakery shop sells 3 types

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!