Question: 1. Section 2.3 describes lists and tuples in Python. Assuming the following assignment statements have been entered at the Python prompt: work_days = (Mon, Tues,

 1. Section 2.3 describes lists and tuples in Python. Assuming the

1. Section 2.3 describes lists and tuples in Python. Assuming the following assignment statements have been entered at the Python prompt: work_days = ("Mon", "Tues", "Wed", "Thu", "Fri") weekend - ("Sat", "Sun") week = work_days + Weekend courses = [ ("CMPSC 8", "MW"), ("CMPSC 8","TR"), ("PSTAT 120", "MW") ] exams = [[1.27, 2.24), (1.28, 2.25), 3.14] (2 pts each) What would be the result of entering the following in IDLE (Python interactive shell)? (Note: You are encouraged to check your answers at the Python prompt before turning in your work, but try this on paper first, just by reading the text and trying to predict what will happen. Then try typing in the results at the Python prompt. Change your answers if they were mistaken, but even more important, try to figure out why you were incorrect). Be very precise. For example, True is not the same in Python as true: upper vs. lower case matters: "UCSB" and ["UCSB") are not the same in Python-one is a string, and the other is a list of length one containing a single string. You will not get full credit for answers that are not precisely correct. Expression Result Expression Result len (work_days) len (courses) len (week) len (exams) 3 3 Page 1 of 3 CS 8 (Winter 2020) Expression Result Expression len (exams[0]) Result 2 len (courses[1]) "CMPSC 8" in courses max (exams (11) 2.25 False "Sun" in week True "CMPSC 8" in courses [2] False

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!