Lesson 8 Flashcards

1
Q

Don’t surround numbers with quotes

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

Integers

A

positive or negative whole numbers. use the int()function.

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

Floats

A

Numbers that have a decimal point. They are used the same way integers are used. To convert an integer or string to float use float()function.

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

Two different types of numbers in python

A

Ints and floats

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

%

A

modulus. It is the remaining portion of a quotient. 5/2 = 2 and remainder of 1. 1 is the modulus.

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

Exponent

A

**

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

Floor division

A

//. Divides two numbers and ignores the remainder. 5/2 = 2. 1 is gone.

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

Lists

A

A variable that stores multiple values. Can store numbers, strings, and other lists.

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

Lists format

A

they use square brackets.

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

The ending index for a list

A

Its not include [1:4] only 2,3,4 will print out of (1,2,3,4,5)

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

Append()function

A

adds a new item to the end of a list

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

remove()function

A

removes an item from a list. You remove using the name of the value not the index number.

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

sort()function

A

Put the list into numerical or alphabetical order

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

reverse()function

A

Puts the list in the reverse order

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

len()function

A

get the number of items in a list and print it.

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

Comparison operators

A

== , !=, <, >, <=, >=