Exam 3: Control Structures

arrow
  • Select Tags
search iconSearch Question
  • Select Tags

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)

A suite in Python is

(Multiple Choice)
4.8/5
(34)

Match the descriptions with their terms: -based on a condition that is checked once

(Multiple Choice)
4.9/5
(44)

While statements always make use of a Boolean expression.

(True/False)
4.9/5
(35)

The Boolean expression 'apple' < 'Banana' evaluates to true.

(True/False)
4.8/5
(38)

Infinite loops are the result of user input errors.

(True/False)
4.9/5
(47)

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)

Evaluate the following Python expressions. -6 != 5

(True/False)
4.8/5
(32)

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. Evaluate the following Python expressions for the variable assignments given.    -num1 == 12 or num1 == num2 or flag1 -num1 == 12 or num1 == num2 or flag1

(True/False)
4.9/5
(41)

The while statement in Python provides iterative control.

(True/False)
4.8/5
(33)

Which form of control does the if statement in Python provide?

(Multiple Choice)
4.9/5
(38)

Evaluate the following Python expressions. -5 > 4 or 12 < 8

(True/False)
4.8/5
(37)
Showing 101 - 120 of 129
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)