Search Header Logo

Python Programming Quiz

Authored by DIVYA VISAKH

Computers

8th Grade

Used 1+ times

Python Programming Quiz
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

30 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is a valid Python expression?

x = 10 +

y = (5 * 3) / 2

print("Hello)

if 5 > 3 print("Yes")

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will L.count(5) return for L = [1, 5, 7, 5, 2, 5]?

2

3

5

Error

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you reverse a list L = [1, 2, 3, 4]?

L[::-1]

reverse(L)

L = L.reversed()

L.append(L.reverse())

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which statement correctly defines a function?

def func():

define func():

function func():

def function():

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is an immutable data type?

List

Set

Tuple

Dictionary

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of print("Python"[::-1])?

nohtyP

Python

Pytho

Error

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does open('file.txt', 'a') do?

Reads a file

Writes to a file

Appends to a file

Overwrites a file

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?