Py4E Assignment Q Flashcards

1
Q

Tuple, P4E, when traversing through a list, how to only select the lines starting with a certain word?

A

]] < for.counter >.startswith( ‘’ )

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

File open, how to open a file?

A

]] open( )

– preferrable to assign the file to a variable

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

How to create a Dictionary?

A

]] = dict()

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

How to assign keys, values to a Dict?

A

]] .[ ] = .get( ,0 )

    • will populate the with the key, value
    • key will be provided from the
How well did you know this?
1
Not at all
2
3
4
5
Perfectly