Answer the question
In order to leave comments, you need to log in
Invalid syntax error
I am new to Python 3 (on which I write, which I have installed), I don’t understand what the error is, I didn’t find my case on the Internet.
The code:
import os
dirpath = os.getcwd()
open('Test', 'w') as file:
file.write('data')
Answer the question
In order to leave comments, you need to log in
import os
dirpath = os.getcwd()
with open('Test', 'w') as file:
file.write('data')
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question