Question: PYTHON QUESTION: Datatypes and Data Handling assorted.py import random biscuits = [] biscuits.extend(['Monte Carlo']*7) biscuits.extend(['Shortbread Cream']*7) biscuits.extend(['Delta Cream']*6) biscuits.extend(['Orange Slice']*6) biscuits.extend(['Kingston']*5) print(' ASSORTED CREAMS ')

PYTHON QUESTION:

Datatypes and Data Handling assorted.py import random biscuits = [] biscuits.extend(['Monte Carlo']*7) biscuits.extend(['Shortbread Cream']*7) biscuits.extend(['Delta Cream']*6) biscuits.extend(['Orange Slice']*6) biscuits.extend(['Kingston']*5) print(' ASSORTED CREAMS ') more = input(' Would you like a biscuit (Y/N)... ') while more != 'N': choice = random.randint(0,len(biscuits)-1) print('Your biscuit is : ', biscuits[choice]) del biscuits[choice] more = input(' Would you like another biscuit (Y/N)...') Modify the code above to.... a) Check if there are any biscuits left before continuing the loop. b) Provide the option to take more than one biscuit at a time. c) Check that there are enough biscuits to be able to take multiple biscuits (b).

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!