Python Advanced Programming HUB Flashcards

1
Q

What does it mean to write to a file?

A
  1. It will erase any information already on the file

2. It will save any information you have written to the file.

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

What does it mean to append a file?

A

You are adding data without reading the data already stored in the file.
If there is data in the file, then the new data will begin where the old data ends.

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

How would I create a new file using python?

A

Open(‘file1’,’w’)

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

How would I make it possible for me to use the os module?

A

But coding in python import os

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

What would I code to get a layout of your current working directory?

A

os.getcwd()

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