Quiz 2

Réussis tes devoirs et examens dès maintenant avec Quizwiz!

Which of the following identifiers follows the naming convention for a python constant?

MAX_PENALTIES

The Python type conversion functions are actually what kind of functions?

Object constructors

interger

int

%

modulus

*

multiplication

The modulus operator (%) is also known as?

remainder operator

Which category of data types represents an ordered collection of values?

sequence

names

string

A variable is a name used to refer to a value stored in the computer's memory

true

For Python, the term data type can be used interchangeably with Class.

true

The following are the reason why we should use constants; -constants convey more meaning than literals -they help prevent errors caused by inappropriate modifications -they make maintenance tasks easier and safer

true

The math module contains a constant that represents the value pi to several digits

true

The naming convention for a python constant is to use all uppercase characters, with individual words separated by an underscore character

true

a constant never changes

true

If the variable num contains a positive integer, what are the only two possible results of the expression num % 2?

0 and 1

//

floor division

any name made up when writing a program is called an

identifier

In dynamically typed languages, variables are declared to store a specific type of data

False

A program is likely to change the value of a variable many times during execution

True

true/false

boolean

which of the following is NOT a constant from the Python Standard Library?

conversions.KILOMETERS_PER_MILE

**

exponentiation

Python is dynamically typed, meaning each variable can only store one type of value.

false

The expression x ^ y raises the value x to the power y.

false

decimals

float


Ensembles d'études connexes

Roles of the Presidency - Part 2

View Set

Chapter 13 communicating effectively

View Set

Exam 4- Sarah Browne Microbiology study guide Ch 21-25

View Set

Temporary Insurance Producer License

View Set

Network Addressing and Basic Troubleshooting: Checkpoint Exam Modules 1-3

View Set

Political Science, Ginsberg Chapter 10 Quiz

View Set

Email Vocabulary Digital Literacy

View Set

Principles of MGMT and Organizational Behavior Quiz 5

View Set