This is the program i have been given. I have to change it to meet the following criteria but can only change the body of the show_flashcard function       # IMPORTANT # Q2 (a)(iii) Make changes only to # -- the docstring for the program as a whole. # -- the docstring of the show_flashcard() function # -- the body of the show_flashcard() function. def show_flashcard():     """ Show the user a random key and ask them         to define it. Show the definition         when the user presses return.         """     random_key = choice(list(word_list))     print('Define: ', random_key)     input('Press return to see the definition')     print(word_list[random_key])      # Set up the word_list word_list = {'black':'noir',             'red':'rouge',             'yellow':'jaune',             'orange':'orange',             'white':'blanc',             'green':'vert'} # The interactive loop exit = False while not exit:     user_input = input('Enter s to show a flashcard and q to quit: ')     if user_input == 'q':         exit = True     elif user_input == 's':         show_flashcard()     else:         print('You need to enter either q or s.')

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

This is the program i have been given.

I have to change it to meet the following criteria but can only change the body of the show_flashcard function

 

 

 

# IMPORTANT
# Q2 (a)(iii) Make changes only to
# -- the docstring for the program as a whole.
# -- the docstring of the show_flashcard() function
# -- the body of the show_flashcard() function.


def show_flashcard():
    """ Show the user a random key and ask them
        to define it. Show the definition
        when the user presses return.    
    """
    random_key = choice(list(word_list))
    print('Define: ', random_key)
    input('Press return to see the definition')
    print(word_list[random_key])
    

# Set up the word_list

word_list = {'black':'noir',
            'red':'rouge',
            'yellow':'jaune',
            'orange':'orange',
            'white':'blanc',
            'green':'vert'}

# The interactive loop

exit = False
while not exit:
    user_input = input('Enter s to show a flashcard and q to quit: ')
    if user_input == 'q':
        exit = True
    elif user_input == 's':
        show_flashcard()
    else:
        print('You need to enter either q or s.')

Word_List_Flashcards.py
File Edit Format Run Options Window Help
# IMPORTANT
# Q2 (a) (iii) Make changes only to
#
#
#
--
--
--
the docstring for the program as a whole.
the docstring of the show_flashcard() function
the body of the show_flashcard() function.
- C:\Users\KGM\Downloads\Word_List_Flashcards.py (3.9.13)
def show_flashcard ():
""" Show the user a random key and ask them
to define it. Show the definition
when the user presses return.
111111
random_key = choice (list (word_list))
print ('Define: ', random_key)
input ('Press return to see the definition')
print (word_list [random_key])
# Set up the word_list
word_list = {'black': 'noir',
'red': 'rouge',
'yellow': 'jaune',
'orange': 'orange',
'white': 'blanc',
'green': 'vert'}
# The interactive loop
exit = False
while not exit:
if user_input
user_input = input('Enters to show a flashcard and q to quit: ')
'g':
else:
==
exit = True
elif user_input = 'S':
show_flashcard ()
I
print('You need to enter either q or s.')
Transcribed Image Text:Word_List_Flashcards.py File Edit Format Run Options Window Help # IMPORTANT # Q2 (a) (iii) Make changes only to # # # -- -- -- the docstring for the program as a whole. the docstring of the show_flashcard() function the body of the show_flashcard() function. - C:\Users\KGM\Downloads\Word_List_Flashcards.py (3.9.13) def show_flashcard (): """ Show the user a random key and ask them to define it. Show the definition when the user presses return. 111111 random_key = choice (list (word_list)) print ('Define: ', random_key) input ('Press return to see the definition') print (word_list [random_key]) # Set up the word_list word_list = {'black': 'noir', 'red': 'rouge', 'yellow': 'jaune', 'orange': 'orange', 'white': 'blanc', 'green': 'vert'} # The interactive loop exit = False while not exit: if user_input user_input = input('Enters to show a flashcard and q to quit: ') 'g': else: == exit = True elif user_input = 'S': show_flashcard () I print('You need to enter either q or s.')
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY