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( ‘’ )
2
Q
File open, how to open a file?
A
]] open( )
– preferrable to assign the file to a variable
3
Q
How to create a Dictionary?
A
]] = dict()
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