Search Header Logo

Python Programming Quiz

Authored by Darren Hong

Information Technology (IT)

University

Used 3+ 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

13 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

15 mins • 1 pt

What is the correct way to define a function in Python?

function myFunc():

def myFunc():

func myFunc():

define myFunc():

2.

MULTIPLE CHOICE QUESTION

15 mins • 1 pt

Which data type is immutable in Python?

List

Dictionary

String

Set

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the correct way to check if "apple" exists as a key in fruits = {"apple": 1, "banana": 2}?

"apple" in fruits

fruits.has_key("apple")

"apple" exists in fruits

if fruits("apple"):

4.

MULTIPLE CHOICE QUESTION

15 mins • 1 pt

What is the output of bool([]) in Python?

True

False

None

Error

5.

MULTIPLE CHOICE QUESTION

15 mins • 1 pt

Which statement is used to handle exceptions in Python?

catch

try-except

error

handle

6.

MULTIPLE CHOICE QUESTION

15 mins • 1 pt

What is the result of 3 * "Python"?

"PythonPythonPython"

["Python", "Python", "Python"]

Error

("Python", "Python", "Python")

7.

MULTIPLE CHOICE QUESTION

15 mins • 1 pt

Is Python a case-sensitive language?

Yes

No

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?