Compsci 101, Sorting
This exercise is for collaborative work during class. Do not fill out early!
Sign in to Google to save your progress. Learn more
Consider the following code segment:
    ans = [('B', 7, 2), ('N', 2, 6 ), ('D',9, 8), ('F', 3, 5)]
   
    x = sorted(ans, key=operator.itemgetter(2), reverse=True)

Which one of the following would be the value of x? *
Consider the following code segment:
    ans = [('B', 7, 2), ('N', 2, 6 ), ('D',9, 8), ('F', 3, 5)]
   
    x = sorted(ans,  reverse=True)
    y = sorted(x, key=operator.itemgetter(2))
Which one of the following would be the value of y? *
Names and Netids below
Names (comma separated) *
netid *
netid (partner)
netid (partner)
netid (partner)
Submit
Clear form
Never submit passwords through Google Forms.
This content is neither created nor endorsed by Google. Report Abuse - Terms of Service - Privacy Policy