Essentials Flashcards

1
Q

Variable

A

A named location in memory that stores a value. Variables don’t have an explicit type and can be reassigned.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Variable Assignment

A

The = operator sets a variable name to a value.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

f-String

A

Formatted string literals that allow embedded expressions using f”” syntax.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Integer

A

Positive or negative whole number with no decimal point. Supports math operations.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Float

A

Number with a decimal point. Common for measurements and math with fractions.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Boolean

A

A True or False value often used for logic.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

None

A

Represents no value assigned. Commonly seen as a default return value.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

If

A

Starts a conditional block that executes in the condition is True.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Else

A

Adds a block that executes if the prior condition(s) was false.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Exception

A

Errors that disrupt normal program flow. Used to catch and handle errors.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Try/Except

A

Catch exceptions in the except block after first trying the code in the try block.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

List

A

An ordered collection of values enclosed in square brackets []. Useful for storing sequences of items.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Index

A

The numeric position of an item in a list. Starts at 0 for the first item. Used to access items by position.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Iteration

A

Repeated execution of code on successive list items. Done in Python with a for-in loop.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Dictionary

A

Unordered collection of key-value pairs denoted with curly braces {}. Keys map to associated values.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Key

A

Unique identifier that is used to look up values in a dictionary. Look ups are 0(1).

17
Q

Value

A

Data associated with a given key in a dictionary. Values can be any Python data type.

18
Q

Tuple

A

Fixed-size, immutable ordered collection similar to a list. Denoted with (). Useful when data shouldn’t change.

19
Q

Set

A

Unordered collection of unique objects. Helpful for removing duplicates and set operations.

20
Q

Membership

A

Ability to check if a value is contained in a collection like lists, dictionaries, tuples, or sets.

21
Q

Methods

A

Built-in functions that allow manipulating and interacting with data structures.

22
Q

Iteration

A

The process of repeatedly executing code on each item in a collection one by one.

23
Q

loop

A

A keyword used for an indefinite loop that runs forever until it is broken out of using a break statement or another control flow mechanism.