Python Ch 2

Ace your homework & exams now with Quizwiz!

Which of the following is not a valid variable identifier?

(A. 88Keys) B. numcredits C. HeSaidSheSaid D. Y2K

Which of the following contain the correct arithmetic operators in Python?

+, -, *, /, //, **

A numeric literal may be an_____or______value

0-9 + -

. Python, the resulting value from a numeric calculation resulting in arithmetic under flow is:

0.0

A calculated result too small to be represented is referred to as________.

0.0

underflow and Overflow

10**-308 to 10**308 with 16 to 17 digits of percision

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

8.1

The_______and_______characters are used in format specifiers in Python to left or right justify a string in a specified field width.

< >

In Python, an empty string is denoted by:

A pair of single quotes containing one blank space A pair of double quotes containing one blank space A pair of matching single or double quotes with no space between them

A backslash \n at the end of a line of a Python program is used to

Allow for an open quoted string to be continued on the next line

The________________operator is used to assign a value to a variable

Assinment

**

Eponentiation

What is displayed by the following? print(format( '-', '->8 '), 'Hello ')

Hello

A numeric literal may be an____or______value

Integer floating-piont

An identifier that already has a predefined meaning in Python, and therefore cannot be used as a variable, is known as a_____________.

Keyword

In Python, string literals may contain

Letters, Digits, Blanks, Spaces, Special Characters.

The number of characters that can be defined in the Unicode character encoding scheme is

Over 4 billion characters

In Python, a string literal can contain

Single quotes, when the string value is delimited by matching double quote Double quotes, when the string value is delimited by matching single quote

The default character encoding scheme of Python_____________.

UTF-8

+

add

Values can be converted from one data type to another by

coercion type conversion

/

division

The built-in____________function of Python can be used to control the display of bothnumeric and string values

format

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

id(k) and id(num) will be the same because they are variables, but not id(10)because it is an immutable valu

An _______________is a sequence of one or more characters that must not begin with a digit.

identifier

1. Python, the resulting value from a numeric calculation resulting in arithmetic overflow is

inf

%

modulus gives remainder

-x

negation or negative number

-

subtract

*

times

//

truncating div evaluates and cuts of numbers behind decimal point. also doesn't round up.


Related study sets

Legal/Ethical Questions - PRACTICE NCLEX-RN

View Set

Chapter 27: Disorders of the Bladder and Lower Urinary tract

View Set

Life Policy Provisions, Riders and Options

View Set

M7- The Patient Who Uses Tobacco

View Set

AST Exam #3 Study Guide (Notes Version)

View Set

HI 101: Making of the Modern World

View Set