Question: 1. Considering the code provided answer the following questions a. What are the names of the functions and what does each one do? b. Which

1. Considering the code provided answer the following questions

1. Considering the code provided answer the following questions a. What are

a. What are the names of the functions and what does each one do?

b. Which functions are Value-Returning Functions?

c. Which functions are Non-Value-Returning Functions?

d. Are there any global variables? If so, mention them

e. Are there any local variables? If so, mention them.

f. Write the statement to invoke each of the functions and what is the output when the function is called (prints, values, etc.)

Ex: See the total sales of the day

Statement: see_sales()

Output: Total Sales: 0

i. See the menu

ii. See Inventory

iii. Add an item

iv. Purchase an item

v. See total amount of money in inventory

sales =0 inventory = [['Item! ' , 2.20], ['1tern2 ' , 4.36], ['1tem3-12.32]] def show menu ): print ('1) Purchase n' '2) See inventory ' '3) Add Item ' '4) See sales ') def see_inventory): for idx in inventory: print (idx[0]+""+str (idx[1])) def add item (item, price): inventory.append ([item,price]) def purchase ): for idx in range (len (inventory) print (str (idx)) tinventory[idx] [0]) index = int (input ('Select a number: if Index >=0: ')) item = inventory [index] del inventory[index] return item[1] #Item price else: print ('Item not found') return 0 def amount_in_inventory): acum = 0 for idx in inventory: acum+=idx [ 1 ] return acum def see sales (): print ('Total Sales: '+sales)

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 Databases Questions!