Python Programming Quiz

Python Programming Quiz

1st Grade

30 Qs

quiz-placeholder

Similar activities

Basic instruction blocks in Scratch

Basic instruction blocks in Scratch

1st - 5th Grade

30 Qs

ASKT3 4.2.4 ATURCARA MELIBATKAN FUNCTION /PROCEDURE

ASKT3 4.2.4 ATURCARA MELIBATKAN FUNCTION /PROCEDURE

1st - 3rd Grade

25 Qs

Quiz Básico de Programação em Python

Quiz Básico de Programação em Python

1st Grade

30 Qs

Procedural Programming Quiz

Procedural Programming Quiz

1st Grade

25 Qs

Python Assessment

Python Assessment

1st Grade

30 Qs

UNIT2&3 PYTHON QUIZ

UNIT2&3 PYTHON QUIZ

KG - University

25 Qs

Scratch Re-cap Quiz

Scratch Re-cap Quiz

1st - 2nd Grade

28 Qs

OSI : TCP / IP

OSI : TCP / IP

1st Grade

31 Qs

Python Programming Quiz

Python Programming Quiz

Assessment

Quiz

Computers

1st Grade

Easy

Created by

Adham Elmuntser

Used 1+ times

FREE Resource

30 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the following code: def greet(): print("Hello, World!") greet()

Hello, Python!

Hello, World!

Hello!

World!

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In the function greet(name), what is name classified as?

A method

A string

A parameter

A loop

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the following function return:

def add(a, b):

return a + b

Sum of a and b

Difference of a and b

Multiplication of a and b

Division of a and b

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the default value for the parameter name in the function definition def greet(name="Guest")?

Alice

Guest

Bob

Python

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What type of object does the function get_min_max(numbers) return?

A list

A dictionary

A tuple

A string

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is a lambda function in Python?

A named function

An anonymous function

A recursive function

A nested function

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the base case in the recursive function

def factorial(n):

if n == 0:

return 1

return n * factorial(n - 1)

n == 1

n == 0

n > 0

n < 0

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?