Py4e: Chapter 2

¡Supera tus tareas y exámenes ahora con Quizwiz!

Which of the following is not a Python reserved word?

speed, spam

What will be the value of x after the following statement executes: x = 1 + 2 * 3 - 8 / 4

5.0

Which of the following is a bad Python variable name?

#spam

What is the value of the following expression: 42 % 10 Hint - the "%" is the remainder operator

2 the remainder since 4*10=40

What will be the value of x when the following statement is executed: x = int(98.6)

98

In the following code, print(98.6) What is 98.6?

A constant

Which of the following elements of a mathematical expression in Python is evaluated first?

Parentheses ( )

What does the Python input() function do?

Pause the program and read data from the user

In the following code, x=42 What is x?

a variable

Assume the variable x has been initialized to an integer value (e.g., x = 3). What does the following statement do? x = x + 2

Retrieve the current value for x, add two to it and put the sum back into x


Conjuntos de estudio relacionados

LC3: LearningCurve - Ch. 3: Supply and Demand

View Set

Exam 3 Econ chapter 13, 14, 15 & 16

View Set

IT B.4 Certification Practice Exam

View Set

QBO ProAdvisor Test Section 4 (87%)

View Set

PMP Exam Prep - Resource Management

View Set

Cell Biology West Final HW Questions

View Set

Chapter 4 - Life Policy Provisions & Options

View Set

Physics- unit 3: Kinematic Equations

View Set