CS 1101: Programming Fundamentals Exam Questions And Answers (Verified And Updated)
CS 1101: Programming Fundamentals Exam Questions And Answers (Verified And Updated) Consider the following Python program. fin = open('') for line in fin: word = () print(word) What does the program loop over? a. Lines in a file b. Lines in a list c. Words in a dictionary d. Words in a list e. Words in a string - answera. Lines in a file Assume the following Python code has already executed. import os cwd = d() Which answer is most likely output from the following Python statement? e(cwd) a. ['Music', 'Pictures', 'Desktop', 'Library', 'Documents', 'Downloads'] b. False c. True d. /Users/me e. /Users/me/Documents/ - answerb. False Assume the following Python code has already executed. import os cwd = d() Which answer is most likely output from the following Python statement? th(cwd) Select one: a. ['Music', 'Pictures', 'Desktop', 'Library', 'Documents', 'Downloads'] b. False c. True d. /Users/me e. /Users/me/Documents/ - answerd. /Users/me What is the output from the following interactive Python statement? >>> '%g' % (0,1) a. '0' b. '0.1' c. TypeError: float argument required, not str d. TypeError: not all arguments converted during string formatting e. TypeError: not enough arguments for format string - answerd. TypeError: not all arguments converted during string formatting What is the output of the following Python program? try: fin = open('') ('Yes') except: print('No') print('Maybe') Select one: a. Yes b. No c. Maybe d. YesMaybe e. NoMaybe - answere. NoMaybe What is the output of the Python code below? print('%d + %d + %d = %d' % (1, 2, 3, 1+2+3)) a. 6 b. (1 + 2 + 3 = 6) c. None d. 1 + 2 + 3 = 6 e. "1 + 2 + 3 = 6" - answerd. 1 + 2 + 3 = 6 Which of the following Python stateme
Written for
- Institution
- CS 1101
- Course
- CS 1101
Document information
- Uploaded on
- May 11, 2024
- Number of pages
- 40
- Written in
- 2023/2024
- Type
- Exam (elaborations)
- Contains
- Questions & answers
Subjects
-
cs 1101 programming fundamentals exam questions a