elena1234

Create and Write in file ( in Python )

Feb 10th, 2022 (edited)
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.19 KB | None | 0 0
  1. with open ("new_test.txt", mode = "w") as file:
  2.     file.write("New Line\n")
  3.  
  4. with open ("new_test.txt", mode = "a") as file:
  5.     file.write("Second Line\n")
  6.     file.write("Third Line\n")
  7.  
Add Comment
Please, Sign In to add comment