Search Header Logo

Writing files in python

Authored by Adrian Ortiga

Computers

9th - 12th Grade

Used 15+ times

Writing files in python
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

13 questions

Show all answers

1.

FILL IN THE BLANKS QUESTION

1 min • 1 pt

One of the simplest ways to save data in Python is to write it to a (a)  

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is one of the simplest ways to save data in python?

At home

Keyword

File

Folder

3.

DRAG AND DROP QUESTION

1 min • 1 pt

When you write text to a ​ (a)   , the output will still be ​ (b)   after you ​ (c)   the terminal containing your program’s ​ (d)   .

file
available
close
output

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

Write python the python code to open a the file "notes.txt" in write mode as file_object.

with open("notes.txt","w") as file_object:
  1. with open("notes.txt","r") as file_object:

  1. with open("notes.txt","a") as file_object:

  1. with open("notes.txt","x") as file_object:

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

Write python the python code to open a the file "data.txt" in reading mode as file_object.

with open("data.txt","r") as file_object:

with open('data.txt','w') as file_object:

with open('data.txt',"a") as file_object:

with open("data.txt",'x') as file_object:

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

Write python the python code to open a the file "students.txt" in append mode as file_object.

with open("students.txt","a") as file_object:

with open('students.txt', 'w') as file_object:

with open('students.txt', "r") as file_object:

with open("students.txt", 'x') as file_object:

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What can Python write to a text file?

numerical data

strings

Boolean values only
Functions and classes

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?