Chapter 2 - Variables and Expressions

0.0(0)
Studied by 0 people
call kaiCall Kai
Locked
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/29

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 6:51 PM on 7/19/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai
Chat

No analytics yet

Send a link to your students to track their progress

30 Terms

1
New cards

variable

a named item that holds a value

2
New cards

assignment statement

assigns a variable with a value using =

3
New cards

incrementing the value

increasing a variable’s value by 1

4
New cards

identifier (name)

a sequence of letters, underscores, and digits that must start with a letter or an underscore

5
New cards

reserved words (keywords)

words that are part of the language and cannot be used as a programmer-defined name

6
New cards

floating-point number

a real number with a decimal point

7
New cards

floating-point literal

a number written as a decimal even if the numbers after the decimal point are 0

8
New cards

scientific notation

1.0e-2

9
New cards

overflow

when a value is too large to be stored in the memory allocated by the interpreter

10
New cards

expression

a combination of items that evaluates to a value

11
New cards

literal

a specific value in code

12
New cards

operator

a symbol that performs a built-in calculations

13
New cards

order of operations

  1. parentheses

  2. exponent

  3. negation

  4. multiplication/division

  5. addition/subtraction

14
New cards

floor division operator (//)

used to round down the result of a floating-point division to the closest smaller whole number value

15
New cards

modulo operator (%)

evaluates the remainder of the division of two integer operands

16
New cards

module

Python code located in another file that can be imported

17
New cards

function

a list of statements that can be executed simply by referring to the function’s name

18
New cards

function call

the processing of invoking a function

19
New cards

argument

the item passed to a function

20
New cards

ceil(x)

round up value

21
New cards

factorial(x)

factorial

22
New cards

fmod(x,y)

remainder of division

23
New cards

fabs(x)

absolute value

24
New cards

floor(x)

round-down value

25
New cards

fsum(x)

floating-point sum of a range, list, or array

26
New cards

exp(x)

exponential function ex

27
New cards

pow(x,y)

raise x to the power of y

28
New cards

log(x, (base))

natural logarithm

29
New cards

sqrt(x)

square root

30
New cards

raw string

putting an r before a string literal so that escape sequences are ignored