ARTS 321
Boston University College Of Arts And Sciences
All 3 results
Sort by
-
CS-1101 Final Exam Part-1 Term 5 /CS 1101 Programming Fundamentals - TQ&A Updated Fall 22/23.erm 5
- Exam (elaborations) • 5 pages • 2023
-
- $9.49
- + learn more
Question 1 
Not yet answered 
Marked out of 
1.00 
Question 2 
Not yet answered 
Marked out of 
1.00 
The Python code below is an example of recursion: 
def fa(): 
 fb() 
def fb(): 
 fa() 
fa() 
Select one: 
True 
False 
What output will the following code produce? 
n = 10 
while n != 1: 
 print (n,) 
 if n % 2 == 0: # n is even 
 n = n // 2 
 else: # n is odd 
 n = n * 3 + 1 
Select one: 
a. 10 5 16 8 4 2 
b. None an error will be displayed 
c. 8 4 2 
d. 9 28 14 7 22 1
-
CS-1101 Final Exam Part-3 Term 5/CS 1101 Programming Fundamentals - Term 5
- Exam (elaborations) • 5 pages • 2023
-
- $9.49
- + learn more
Question 21 
Answer saved 
Marked out of 
1.00 
Question 22 
Answer saved 
Marked out of 
1.00 
The invert_dict Python function is supposed to invert a 
dictionary. Based on the sample input and the output shown 
below, the function is correct. 
invert_dict({1: 10, 2: 10, 3: 20}) 
 {10: [1, 2, 3], 20: [3]} 
Select one: 
True 
False 
Boolean expressions control _________________ 
Select one: 
a. recursion 
b. conditional execution 
c. alternative execution 
d. all of the
-
CS-1101 Final Exam Part-2 Term 5 Q&A Updated Fall 22/23.
- Exam (elaborations) • 5 pages • 2023
-
- $9.49
- + learn more
What output will the following code produce? 
def area(l, w): 
 temp = l * w; 
 return temp 
l = 4.0 
w = 3.25 
x = area(l, w) 
if ( x ): 
 print (x) 
Select one: 
a. 13.0 
b. 0 
c. Expression does not evaluate to boolean true 
d. 13 
Which of the following types are allowed for Python 
dictionary keys? 
Select one: 
a. dictionary 
b. dictionary of lists 
c. list 
d. tuple 
e. A
As you read this, a fellow student has made another $4.70
How did he do that? By selling his study resources on Stuvia. Try it yourself! Discover all about earning on Stuvia