Question: Can someone help me correct my code where the ? ? ? are? # candies LIST on startup candies = [ ' M&Ms ' ,

Can someone help me correct my code where the ??? are?
# candies LIST on startup
candies =['M&Ms','Snickers','Twizzlers','Kit-Kat','Butterfinger','Twix',
'Skittles','Starburst','Smarties','Nerds','SweetTarts','Rolo']
# DISPLAY the program HEADER.
def display_banner():
print()
print("=====================================================")
print("================== Candy Program ====================")
print("=====================================================")
# DISPLAY the user MENU options.
def display_menu():
print("
Menu Options:")
print("--------------")
print("1.) Display the list of candies")
print("2.) Display how many candies are in the list")
print("3.) Return the index number of a queried candy")
print("4.) Search the list for a Candy and display search results")
print("5.) Add a candy to the front of the list")
print("6.) Add a candy to the end of the list")
print("7.) Add a candy to the 2nd to the end of the list")
print("8.) Add a candy to the end of the list only if it does not exist in the
list")
print("9.) Remove a candy from the list")
print("10.) Sort the candies list (ascending order)")
print("11.) Sort the candies list (descending order)")
print("12.) Display the first and last candies in the sorted (ascending) list")
print("13.) Display the candies in the sorted (ascending order) list A thru L")
print("14.) Display the candies in the sorted (ascending order) list M thru Z")
print("15.) Exit/End the program")
# Display all candies in the candies list.
def display_candies():
print("
===== Candy List =====")
???
print(index)
print("======================")
# Display how many candies are available in the list.
def number_of_candies():
num_candies =???
print(f"
There are {num_candies} candies in the list.")
# FIND the index number (list position) of a queried candy.
def find_candy_index():
candy = input("
Enter the candy to find its index: ")
candy = candy.???
if candy in candies:
index =???
print(f"
The Candy '{candy}' is found at index: {index}.")
else:
print(f"
'{candy}' is not found in the list.")
# SEARCH the candies list for for a specific candy.
def search_list():
candy = input("
Enter the Name to search: ")
candy = candy.title()
???
print(f"
{candy} is in the list.")
else:
print(f"
{candy} is not in this list")
# ADD a new candy to the front of the list.
def add_to_front():
candy = input("
Enter the Candy to add: ")
candy = candy.capitalize()
???
print(f"
'{candy}' was added to the front of the list.")
display_candies()
# ADD a new candy to the end of the list.
def add_to_end():
candy = input("
Enter the Candy to add: ")
candy = candy.capitalize()
???
print(f"
'{candy}' was added to the end of the list. ")
display_candies()
# ADD a new candy second to the last of the list
def second_to_last():
candy = input("
Enter the Candy to add: ")
candy = candy.capitalize()
???
print(f"
'{candy}' was added second to the last of the list. ")
display_candies()
# ADD a candy only if it is not already on the list
def does_not_exist():
new_candy = input('Enter the new Candy to add: ')
new_candy = new_candy.capitalize()
if ???
candies.append(new_candy)
print(f"
'{new_candy}' was added to the end of the list.")
display_candies()
else:
print(f"
'{new_candy}' already exists in the list.")
# REMOVE a candy from the list.
def remove_entry():
candy = input("
Enter the candy to remove: ")
candy = candy.capitalize()
if candy in candies:
???
print(f"
'{candy}'was removed from the list.")
display_candies()
else:
print(f"
'{candy}' was not found in the list.")
# SORT the candies list in alphabetical order (ASCENDING order).
def sort_candies():
???
print("
The candies are organized in ascending order.")
display_candies()
# SORT the candies list in Descending order.
def sort_descending_candies():
???
print("
The candies are organized in descending order.")
display_candies()
# SORT the list and then gets the first and last candy on the list
def first_and_last_candies():
candies.sort()
first =???
last =???
print(f'
The first candy in the list is {first} and the'
f' last candy in the list is {last}.')
# DISPLAY the sorted candies on the list from A through L.
def display_sorted_by_letters_AL():
candies.sort()
print("
===== Candies from A through L =====")
for candy in candies:
if ???
print(candy)
print("====================================")
# Display the sorted candies on the list from M through Z
def display_sorted_by_letter_MZ():
print("
===== Candies from M through z =====")
for candy in candies:
if ???
print(candy)
print("====================================")
# EXIT the program with a goodbye message.
def exit_program():
print("
Exiting the Candy organizing Program. Goodbye!")
# ASK user to a ENTER a NUMBER from 1-15 in the MENU.
def main():
display_banner()
Continue = 'Yes'
while Continue == 'Yes':
display_menu()
choice = input("
Enter your choice (1-15): ")
if choice =='1':
display_candies()

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!