Exam 3: Control Structures

arrow
  • Select Tags
search iconSearch Question
  • Select Tags

The Boolean expression 'Abe' < 'Apple' evaluates to true.

(True/False)
4.9/5
(44)

The != operators is used to determine if two values are not equal to each other.

(True/False)
4.9/5
(39)

In the following lines of code, which line is the header? In the following lines of code, which line is the header?

(Multiple Choice)
4.8/5
(27)

For a variable named with integer value, give an if statement that displays "valid value" if the value of num is between 1 and 100, inclusive, and displays "invalid value" otherwise.

(Essay)
4.9/5
(28)

Match the expressions that they are logically equivalent to the Boolean expressions : -(not x) or (not y)

(Multiple Choice)
4.9/5
(30)

Evaluate the following Python expressions. -not (12 == 12 and 4 < 6)

(True/False)
4.8/5
(34)

Which of the following is not a Boolean operator?

(Multiple Choice)
4.8/5
(40)

Write simple Python program that determines a person's age (in years) by prompting for the current month, day and year and the month, day and year that they were born. Design the program so that all values are entered as integer values (i.e., integer values for months). The program must compare the month and day information (in addition to the years) to determine if a person's birthday has yet passed for the current year. (If the current day is their birthday, then consider them a year older than they would have been the day before.)

(Essay)
4.7/5
(29)

For variable current_month (equal to 'January' or 'February' ot 'March', etc.) write an if statement that assigns variable fall_season to True if the value of current_month is either 'September', 'October' or 'November'; otherwise, fall_season should have the value False.

(Essay)
4.9/5
(39)

Write a simple Python program that prompts the user for a letter (in lower case) to search for, and then prompts the user to enter a series of words (using all lower case letters), one by one, until the Enter key is hit. The program should display how many of the words entered contained the search letter.

(Essay)
4.8/5
(34)

The operators and, or, not, ==, !=, <, <=, >, >= are called Boolean operators.

(Short Answer)
4.9/5
(33)

Examine the following lines of code: Current = 1 Sum = 0 N = 5 While current <= n: Sum = sum + current What is the value of sum after the loop completes all of its iterations?

(Multiple Choice)
4.9/5
(43)

Examine the following lines of code: Which = input('Please enter 'F' or 'C') While which != 'F' and which != 'C': Which = input('Please enter 'F' or 'C') This is an example of:

(Multiple Choice)
4.9/5
(38)

1 <= num <= 10 is not a valid Boolean expression in most programming languages, but is allowed in Python.

(True/False)
4.9/5
(34)

Give an appropriate expression for each of the following: -To determine if the number 25 appears in a list of numbers called nums.

(Short Answer)
4.9/5
(42)

Match the expressions that they are logically equivalent to the Boolean expressions : -(not x) and (not y)

(Multiple Choice)
4.9/5
(27)

A _____________ expression is an expression that evaluates to True or False.

(Short Answer)
4.8/5
(43)

not (flag1 and flag2) is logically equivalent to (not flag1) and (not flag2), where flag1 and flag2 are Boolean values.

(True/False)
4.8/5
(40)

The relational operators can be applied to string values.

(True/False)
4.8/5
(40)

Evaluate the following Python expressions for the variable assignments given. Evaluate the following Python expressions for the variable assignments given.    -num1 + 10 < num2 and flag2 -num1 + 10 < num2 and flag2

(True/False)
4.9/5
(40)
Showing 61 - 80 of 129
close modal

Filters

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