Search Header Logo

Review

Authored by Yhasnaya Soriano

Other

University

Review
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

20 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following statements are NOT true regarding the opening modes of a file?

When you open a file for reading, if the file does not exist, an error occurs.

When you open a file for writing, if the file does not exist, an error occurs

When you open a file for writing, if the file does not exist, a new file is created.

When you open a file for writing, if the file exists, the existing file is overwritten during the write

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

a=10

b=20

c=a+e

What kind of exception occurs here?

NameError

ValueError

TypeError

No Exception

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which function read single line at a time?

read()

read(n)

readline()

readlines()

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Choose the correct statement to close a file stream named myfile:

myfile.terminate()

myfile.end()

myfile.close()

myfile.remove()

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which one is the powerful function used for formatting strings?

chr( )

format( )

capitalize( )

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will the output be from the following code?
print("Hello" + "world" + "today")

Helloworldtoday

Hello world today

"Hello" "world" "today"

SyntaxError

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which file is not a binary file?

student.mp4

student.jpeg

student.csv

student.exe

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?