Python Testing

Python Testing

9th - 12th Grade

10 Qs

quiz-placeholder

Similar activities

Kuis Dadakan ;)

Kuis Dadakan ;)

10th Grade - University

15 Qs

Паскаль. Основные команды

Паскаль. Основные команды

8th - 11th Grade

10 Qs

ICT as Social Change

ICT as Social Change

12th Grade

10 Qs

Evaluasi Materi Integrasi Aplikasi Office

Evaluasi Materi Integrasi Aplikasi Office

10th Grade

15 Qs

สอบย่อย ครั้งที่ 1 (BC.2/2)

สอบย่อย ครั้งที่ 1 (BC.2/2)

11th Grade

10 Qs

HTML & Google Site Seatwork

HTML & Google Site Seatwork

12th Grade

10 Qs

Komputer

Komputer

10th Grade

15 Qs

Cyber Security Homework 1

Cyber Security Homework 1

7th - 9th Grade

15 Qs

Python Testing

Python Testing

Assessment

Quiz

Computers

9th - 12th Grade

Hard

Created by

Samuel Markham

Used 10+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Function definitions in Python start with what keyword?

def

fun

function

define

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

A function parameter is a kind of variable accessible...

within the function body
outside the function body
only by the main function
in a separate file

3.

MULTIPLE SELECT QUESTION

45 sec • 1 pt

Which two statements are true?

The return keyword forces a function to restart its execution

The return keyword may cause the function to return a value

The return keyword forces the function's execution to terminate

The return keyword can only appear once inside a function

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the following Python code?

tup = (1, ) + (1, )

tup = tup + tup

print(len(tup))

2

4

0

the snippet causes an error

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

What is the output of the following code if the user enters "kangaroo" as their first prompt and 0 as their second?

Error.Error.Error

4.0

Do not divide by Zero!

Wrong value.

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the expected behaviour of the following snippet if the user enters 0?

value = input("Enter a value: ")

print(10 / value)

The program will raise a ValueError exception

The program will raise the ZeroDivisionError exception

The program will raise the TypeError exception

The program will output 0 to the console

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the following Python code?

list = [1, 2, 3, 4]

print(list[4])

4

1

the snippet causes an IndexError

None

Create a free account and access millions of resources

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

By signing up, you agree to our Terms of Service & Privacy Policy

Already have an account?

Discover more resources for Computers