Section 1

Preview this deck

operations are done _________ not, and, or

Front

Star 0%
Star 0%
Star 0%
Star 0%
Star 0%

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Active users

0

All-time users

0

Favorites

0

Last updated

6 years ago

Date created

Mar 1, 2020

Cards (29)

Section 1

(29 cards)

operations are done _________ not, and, or

Front

before

Back

list.insert(I,x)

Front

Insert an item at a given position. The first argument is the index of the element before which to insert, so a.insert(0, x) inserts at the front of the list, and a.insert(len(a), x) is equivalent to a.append(x).

Back

list.extend(L)

Front

extend list by adding all items in given list

Back

end=' ' in print statements

Front

keeps it all on the same line

Back

string literal has

Front

quotes

Back

2 + 3.0 returns a

Front

float type

Back

strings are immutable meaning

Front

they can't be changed

Back

list.index(x)

Front

Return the index in the list of the first item whose value is x. It is an error if there is no such item.

Back

range(0,10,3) produces

Front

[0,3,6,9]

Back

list.reverse()

Front

reverses the order of the elements in the list

Back

to change a string ie make it capital you have to

Front

create a new string

Back

tuple is a list that can not be

Front

changed

Back

len() finds

Front

length of string

Back

To iterate over the indices of a sequence, you can combine range() and len() as follows:

Front

for I in range(Len(a)): print(I,a[I])

Back

list.pop([i])

Front

Deletes the ith element in the list and returns its value

Back

list.append(x)

Front

adds item to end of list

Back

list.remove(x)

Front

remove first item in list whose value is x

Back

converting float to int -->

Front

truncates the float into integer

Back

print('1
2
3') output

Front

1 2 3

Back

a dictionary captures

Front

relationships between elements ie names and ages

Back

you can't use equality operators to compare what data type?

Front

floating point ie you can't say x = 4.35

Back

floating point literal includes the

Front

decimal ie 1.0 3.0

Back

list can contain

Front

different elements ie 2, 'e', 3

Back

input() inherent data type is a

Front

string

Back

list.sort

Front

Sorts all the items and updates the list at the same time

Back

list.count(x)

Front

Return the number of times x appears in the list.

Back

strings can only contain

Front

single characters ie text

Back

not is first then

Front

and then or

Back

info = ( )

Front

tuple

Back