QUESTION IMAGE
Question
question # 3
multiple select
which of these statements are true? select 2 options.
the new line character is \\
ewline\.
python can only be used with files having \.py\ as an extension.
if you open a file in append mode, the program halts with an error if the file named does not exist.
in a single program, you can read from one file and write to another.
if you open a file in append mode, python creates a new file if the file named does not exist.
- The new - line character in Python is '
', not '
ewline', so the first option is false.
- Python code can be run in interactive mode or in files with other extensions (e.g., in Jupyter notebooks with.ipynb), not only with.py extension, so the second option is false.
- When opening a file in append mode ('a') in Python, if the file does not exist, Python creates a new file instead of halting with an error, so the third option is false.
- In Python, it is common to read from one file and write to another in a single program, for example, when processing data from a source file and saving the results to a new file. This option is true.
- When opening a file in append mode in Python, if the file does not exist, a new file is created. This option is true.
Snap & solve any problem in the app
Get step-by-step solutions on Sovi AI
Photo-based solutions with guided steps
Explore more problems and detailed explanations
D. In a single program, you can read from one file and write to another.
E. If you open a file in append mode, Python creates a new file if the file named does not exist.