CH2 - Variables & Simple Data Types Flashcards

1
Q

Variable

A

Reserved memory location to store values

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

.py

A

Python file extension

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

Syntax highlighting

A

Makes the code more readable, and It can also help identify problems with examples.

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

Rules for naming variables in python

A
  1. Must start with a letter or the underscore character.
  2. A variable name cannot start with a number.
  3. Can only contain alpha-numeric characters and underscores (A-z, 0-9, and _ ).
  4. Names are case-sensitive.
  5. No spaces.
  6. Do not use Python keywords.
  7. Must be short and descriptive.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Traceback error

A

A record of where the IDE had trouble running the code.

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

Strings

A

Characters inside quotes.

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

Integers

A

Whole numbers, no fractions.

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

Floats

A

Numbers with a decimal point

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

Operations with Integers and Floats

A

The result will always be a float.

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

F-String

A

How to insert variable values into a string.

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

Methods

A

Action that Python performs on data.

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

.tittle()

A

Python method. Title case string.

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

.lower()

A

Python method. lower case string.

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

.upper()

A

Python method. upper case string.

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

\t

A

Tab. adds a tab space into text.

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

\n

A

New Lines. adds a new line into text.

17
Q

How to remove whitespaces

A
  1. rstrip()
  2. lstrip()
  3. strp()
18
Q

a, b, c = 1, 2, 3

A

How to assign multiple values into multiple variables.

19
Q

Comments

A

Adds non-executable comments to the code.

20
Q

Constant variable

A

Variable whose value never changes.