up ex.35
This commit is contained in:
parent
7645242f74
commit
78211363b9
5 changed files with 147 additions and 5 deletions
|
|
@ -8,17 +8,14 @@ print(f"We're going to erase {filename}.")
|
|||
print("If you don't want that, hit CTRL-C (^C).")
|
||||
print("If you do want that, hit RETURN.")
|
||||
|
||||
|
||||
input("?")
|
||||
|
||||
print("Opening the file...")
|
||||
target = open(filename, 'w')
|
||||
|
||||
print("Truncating the file.
|
||||
print("Truncating the file. Goodbye!")
|
||||
target.truncate()
|
||||
|
||||
Goodbye!")
|
||||
|
||||
|
||||
print("Now I'm going to ask you for three lines.")
|
||||
|
||||
|
|
@ -37,5 +34,4 @@ target.write(line3)
|
|||
target.write("\n")
|
||||
|
||||
print("And finally, we close it.")
|
||||
|
||||
target.close()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue