Exam 2: Data and Expressions

arrow
  • Select Tags
search iconSearch Question
  • Select Tags

Subexpressions may not contain subexpressions of their own.

(True/False)
4.9/5
(34)

Values can be converted from one data type to another by

(Multiple Choice)
4.7/5
(34)

The format function is only for use with numeric values.

(True/False)
4.9/5
(43)

The following expression is an example of (float) 2 + 4.5

(Multiple Choice)
4.9/5
(35)

For the following input statement in which the user enters as input 35, what is displayed by the following Age = input('Enter your age: ') Print("You are", age//10, "decades old")

(Multiple Choice)
4.7/5
(38)

A variable in Python is an identifier that is assigned a value.

(True/False)
4.8/5
(32)

Assume that variables k and num have both been initialized to 10, which of the following is true?

(Multiple Choice)
4.8/5
(36)

Match the respective data types with their value: -Float

(Multiple Choice)
4.7/5
(44)

Indicate what is displayed by the following print statement, for n = 8.096. Print('n = ', format(n,'.1f'))

(Multiple Choice)
4.8/5
(40)

Give two expressions in Python, one using the minus symbol (-) as a unary operator, and one using it as a binary operator.

(Short Answer)
4.8/5
(31)

Since any floating-point representation contains only a finite number of digits, what is stored for many floating-point values is only an approximation of the true value.

(True/False)
5.0/5
(32)

In Python, string literals may contain

(Multiple Choice)
4.8/5
(28)

Python built-in functions _____ and _____ can be used to convert a string type to a numeric type.

(Short Answer)
4.9/5
(38)

Truncated division, denoted by //, truncates the result of a division operation as either an integer or floating-point value, based on the types of operands it is applied to.

(True/False)
4.8/5
(33)

In Python, string literals may contain quotes as part of its value.

(True/False)
4.9/5
(46)

In Python, a comma can be used in numerical literal values greater than 999. That is, one thousand can be represented as either 1,000 or 1000 within a Python program.

(True/False)
4.8/5
(32)

In Python, the resulting value from a numeric calculation resulting in arithmetic underflow is

(Multiple Choice)
4.9/5
(41)

Identifiers in Python may not contain blank characters.

(True/False)
4.8/5
(34)

Match the respective data types with their value: -Integer

(Multiple Choice)
4.8/5
(45)

Give the character endoding of the letter 'D' in Python.

(Short Answer)
4.7/5
(39)
Showing 41 - 60 of 71
close modal

Filters

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