Writing files in python

Writing files in python

9th - 12th Grade

13 Qs

quiz-placeholder

Similar activities

CUET Level - II Computer Science(7/11/2023)

CUET Level - II Computer Science(7/11/2023)

12th Grade

15 Qs

Python Pliki

Python Pliki

12th Grade

10 Qs

Python Final Assessment

Python Final Assessment

4th - 12th Grade

10 Qs

File handling

File handling

12th Grade

10 Qs

Python Reading files

Python Reading files

9th - 12th Grade

9 Qs

Creating a document

Creating a document

1st Grade - Professional Development

9 Qs

File Types

File Types

12th Grade

18 Qs

Text File - Quiz

Text File - Quiz

12th Grade - University

10 Qs

Writing files in python

Writing files in python

Assessment

Quiz

Computers

9th - 12th Grade

Medium

Created by

Adrian Ortiga

Used 11+ times

FREE Resource

13 questions

Show all answers

1.

FILL IN THE BLANK QUESTION

1 min • 1 pt

One of the simplest ways to save data in Python is to write it to 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

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?