CS 1101 Programming Fundamentals Final Exam Review with Complete Solutions
CS 1101 Programming Fundamentals Final Exam Review with Complete Solutions What output will the following Python program produce? n = 10000 count = 0 while n: count = count + 1 n = n / 10 n=int(n) print(count) 5 What output will the following Python commands produce? >>> percentage = float ( 60 * 100) / 55 >>> print (percentage) 109. What does the following Python 3 function do? def subroutine(n): while n > 0: print (n,) n -= 1 Counts from n down to 1 and displays each number What is the output of the following Python 3 statements? x=1 y=2 if x == y: print (x, "and", y, "are equal") else: if x < y: print (x, "is less than", y) else: print (x, "is greater than", y) 1 is less than 2 The statements inside of a Python loop are known as the ____ of the loop. body What is the output of the following Python program? pi = int(3.14159) print (pi) 3 What output will the following interactive Python statements produce? >>> n = 2 >>> n += 5 >>> n 7 What output will the following Python 3 program produce? x = 5 if x % 2 == 0: print (x) else: print (x, x%2) 5 1
Written for
- Institution
- CS 1101 Programming Fundamentals
- Course
- CS 1101 Programming Fundamentals
Document information
- Uploaded on
- May 18, 2024
- Number of pages
- 24
- Written in
- 2023/2024
- Type
- Exam (elaborations)
- Contains
- Questions & answers
Subjects
-
cs 1101 programming fundamentals final exam review
Also available in package deal