Computer Science > EXAM > CS 1101 Final Quiz | 30 Question & Answers on the exam questions. (All)
CS 1101 Final Quiz | 30 Question & Answers on the exam questions. Question text After the Python code below has run, what happens if 'the_file' does not already exist? try: fin = open('the_file'... , 'r') except: fin = open('the_file', 'w') fin.close() Select one: a. A run-time error is printed out b. An exception is printed out c. Nothing d. An empty file is created e. Syntax error Question 2 Answer saved Marked out of 1.00 Flag question Question text The Python code below is an example of recursion: def fa(): fb() def fb(): fa() fa() Select one: True False Question 3 Answer saved Marked out of 1.00 Flag question Question text Assume that d is a Python dictionary. What does the following Python code produce? d.items() Select one: a. a histogram b. an inverted dictionary c. a list of tuples d. a lookup e. a reverse lookup Question 4 Answer saved Marked out of 1.00 Flag question Question text Generally speaking, filter list operations produce a different number of list elements compared to map operations. Select one: True False Question 5 Answer saved Marked out of 1.00 Flag question Question text What is the output of the Python method call below? "bib".find('b', 1, 2) Select one: a. 0 b. 2 c. -1 d. syntax error e. 3 [Show More]
Last updated: 6 months ago
Preview 4 out of 15 pages
Loading document previews ...
Buy this document to get the full access instantly
Instant Download Access after purchase
Buy NowInstant download
We Accept:
Can't find what you want? Try our AI powered Search
Connected school, study & course
About the document
Uploaded On
Jun 07, 2021
Number of pages
15
Written in
This document has been written for:
Uploaded
Jun 07, 2021
Downloads
0
Views
139
In Scholarfriends, a student can earn by offering help to other student. Students can help other students with materials by upploading their notes and earn money.
We're available through e-mail, Twitter, Facebook, and live chat.
FAQ
Questions? Leave a message!
Copyright © Scholarfriends · High quality services·