CS 1101 Programming Fundamentals Final Exam Review Questions with 100% Correct Answers
CS 1101 Programming Fundamentals Final Exam Review Questions with 100% Correct Answers 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) - answer5 What output will the following Python commands produce? >>> percentage = float ( 60 * 100) / 55 >>> print (percentage) - answer109. What does the following Python 3 function do? def subroutine(n): while n > 0: print (n,) n -= 1 - answerCounts 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) - answer1 is less than 2 The statements inside of a Python loop are known as the ____ of the loop. - answerbody What is the output of the following Python program? pi = int(3.14159) print (pi) - answer3 What output will the following interactive Python statements produce? >>> n = 2 >>> n += 5 >>> n - answer7 What output will the following Python 3 program produce? x = 5 if x % 2 == 0: print (x) else: print (x, x%2) - answer5 1 What is the value of the variable index after the Python code below is executed? word = 'bAnana' index = ('a') - answer3 Repeated execution of a set of programming statements is called repetitive execution. Select one: - answerFalse With built in functions, it is generally acceptable to take a "Leap of Faith". - answerTrue Match the following terms and definitions The order in which statements are executed during a program run. Answer 1 Correct The first part of a compound statement begins with a keyword and ends with a colon ( : ) Answer 2 Correct A statement that executes a function. It consists of the name of the function followed by a list of arguments enclosed in parentheses. Answer 3 Correct A variable defined inside a function that can only be used inside its function. Answer 4 Correct A graphical representation of functions, their variables, and the values to which they refer.
Written for
- Institution
- CS 1101
- Course
- CS 1101
Document information
- Uploaded on
- April 3, 2024
- Number of pages
- 13
- Written in
- 2023/2024
- Type
- Exam (elaborations)
- Contains
- Questions & answers
Subjects
-
cs 1101 programming fundamentals final exam review