Question: Python 3.0 HELP!!! (NOT JAVA) print('Testing index_responses()') print(index_responses(['a', 'b', 'c'])) print(index_responses(['a','a','c','b'])) print(index_responses(['d','d','b','e','e','e','d','a'])) Purpose: To practice the concept of dictionary as a mapping. Degree of Difficulty:

Python 3.0 HELP!!! (NOT JAVA)

Python 3.0 HELP!!! (NOT JAVA) print('Testing index_responses()') print(index_responses(['a', 'b', 'c'])) print(index_responses(['a','a','c','b'])) print(index_responses(['d','d','b','e','e','e','d','a']))

print('Testing index_responses()') print(index_responses(['a', 'b', 'c'])) print(index_responses(['a','a','c','b'])) print(index_responses(['d','d','b','e','e','e','d','a']))

Purpose: To practice the concept of dictionary as a mapping. Degree of Difficulty: Easy. Write a function, called index responses, that takes a list of multiple choice responses, e.g., a', 'b', 'c'l, as an argument, and returns a dictionary of question-response pairs ra1 a', 'Q2':'b', 'Q3'?c't. Your function should work for lists of any size. Before going on, you want to be sure that your function works properly. Add the following testing code to your program (you can find this code in a3q2-testing. py: print 'Testing index responses print (index-responses CC a 'b', 'c'])) print (index responses (C' a 'a', "c' 'b' j)) print (index responses (C 'd', 'd', 'b', 'e', 'e','e', a You should see console output like this: Testing index responses I'Q1 'a', Q2 'b', 'Q3': 'c') I'Q1 'a', 'Q4': 'b', 'Q2': 'a', 'Q3': 'c') i'Q7': 'd', Q1 'd', 'Q6': 'e', 'Q3': 'b', 'Q5': 'e' 'Q8': 'a', 'Q2': 'd', 'Q4': 'e' Python decides what order to put the questions, so if you get a different ordering, that's fine. You should check that all the questions are there, and that all the responses are appropriate. When you are confident that your function works, comment out the above testing code and move on to the next

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!