
* 겪고 있는 문제 상황을 최대한 자세하게 작성해주세요.
* 문제 해결을 위해 어떤 시도를 해보았는지 구체적으로 함께 알려주세요.
1-5 강의 파일 생성과 조작 부분에서,
저장하고 실행 시, 파일이 생성되지 않고
NameError, SyntaxError가 발생하고 있습니다.

작성한 코드 및 에러 메세지
Python 3.10.11 (v3.10.11:7d4cc5aa85, Apr 4 2023, 19:05:19) [Clang 13.0.0 (clang-1300.0.29.30)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> f.close() #파일을 열고 작업을 완료한 후 파일 닫기
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'f' is not defined
>>> /usr/local/bin/python3 /Users/ddoni/Desktop/automation/file.py
File "<stdin>", line 1
/usr/local/bin/python3 /Users/ddoni/Desktop/automation/file.py
^
SyntaxError: invalid syntax
