Exam 3: Control Structures
Exam 1: Introduction102 Questions
Exam 2: Data and Expressions71 Questions
Exam 3: Control Structures129 Questions
Exam 4: Lists85 Questions
Exam 5: Functions83 Questions
Exam 6: Objects and Their Use54 Questions
Exam 7: Modular Design62 Questions
Exam 8: Text Files58 Questions
Exam 9: Dictionaries and Sets33 Questions
Exam 10: Object-Oriented Programming81 Questions
Exam 11: Recursion27 Questions
Select questions type
All Boolean expressions contain at least one Boolean literal (value).
(True/False)
4.7/5
(47)
Construct multiway based on the value of variable n with an integer value in the range 1-100, so that if n is less than or equal to 25, "very low value" is displayed; if n is greater than 25 and less than or equal to 50, "low value" is displayed; if n is greater than 50 and less than or equal to 75, "median value" is displayed; otherwise, "high value" is displayed.
(Essay)
4.9/5
(41)
In Python, __________________ is used to denote the nesting of statements.
(Short Answer)
4.8/5
(41)
Match the descriptions with their terms:
-based on a condition that is checked once
(Multiple Choice)
4.9/5
(44)
Write a simple Python program that reads in three integer values from the user, and displays "Numbers Unique" if each of the values are different, otherwise displays "Duplicate Values Found."
(Essay)
4.9/5
(39)
Give a while loop that adds up all the even numbers between 2 and 200, inclusive, and displays the result.
(Essay)
4.9/5
(31)
Which of the following provide explicit control flow in a program?
(Multiple Choice)
4.7/5
(29)
For variable sunny assigned a Boolean value, and variable temperature assigned an integer value, write Python code that displays "Swimming Day" if it is a sunny day and the temperature is at least 80 degrees, or if it is a cloudy day and the temperature is at least 84 degrees; otherwise, "Not a Swimming Day" should be displayed.
(Essay)
4.9/5
(34)
The statements in a while loop are always executed at least once.
(True/False)
4.9/5
(29)
Examine the following expression.
10 in (10, 20, 30)
What will this expression evaluate to?
(Multiple Choice)
4.9/5
(26)
not (num != 0) is logically equivalent to num < 0 and num > 0, for integer value num.
(True/False)
4.9/5
(26)
Evaluate the following Python expressions for the variable assignments given.
-num1 == 12 or num1 == num2 or flag1

(True/False)
4.9/5
(41)
Which form of control does the if statement in Python provide?
(Multiple Choice)
4.9/5
(38)
Showing 101 - 120 of 129
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)