Skip to content
Solution Debug 7.3. Dodgy Doughnuts
  • Pages
    • Solution
    • The Task
    • icon picker
      Python Starter Code
    • CodeClips

Python Starter Code

Copy and paste the code below into your main.py file before you begin the task.
# sets up array of strings
doughnuts = ['Chocolate Sprinkles', 'Lotus Biscoff', 'Glazed Raspberry', 'Vegan Caramel Iced Ring',
'Cookies and Kreme', 'Chocolate Dreamcake', 'Strawberries and Kreme', 'Original Glazed', 'Nutty Chocolatta',
'Vegan Strawberry Iced Ring']

# print the menu
print('\n\nDoughnuts Menu\n\n')

# display all the doughnut options in the array
for i in range(0, 4, 1) :
print(str(i + 1) + ' : ' + doughnuts[1])
# end loop


print('\n\n') # display blank line (2)


# allow the customer to pick 4 doughnuts
for i in range(0, len(doughnuts), 1) :
# get the number for the doughnut
choice = int(input('Pick your next doughnut, enter the menu number: '))

# display the doughnut from the user's chosen array element
print('Great choice - ' + doughnuts[i])
print("\n")
# end loop
 
Want to print your doc?
This is not the way.
Try clicking the ··· in the right corner or using a keyboard shortcut (
CtrlP
) instead.