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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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.

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