Midterm3 Flashcards
1
Q
What does each one of these modes do when opening a file?
-r
-w
-x
-a
A
-r: reading only
-w: writing only. Overrites existing file, and creates a new one if it does not exist
-x: Writing only. Creates file if it does not exist. If it does already exist, it raises FileExistsError
-a: Writing only. Creates if file does not exist. Appends if it does.
2
Q
are parameters and args the same when thinking specifically about calling or defining a func?
A
No. Parameters are the ones when defining a func., and when it is called, they are called arguments.
3
Q
A