Python Functions Quiz

Python Functions Quiz

University

50 Qs

quiz-placeholder

Similar activities

PPS TEST 4

PPS TEST 4

University

47 Qs

Ôn tập

Ôn tập

10th Grade - University

46 Qs

Analisis Data YPK

Analisis Data YPK

7th Grade - University

50 Qs

KLA Quiz Struktur Data UAS

KLA Quiz Struktur Data UAS

University

50 Qs

Data Structures and Algorithms Quiz

Data Structures and Algorithms Quiz

University

50 Qs

Function in Python

Function in Python

University

45 Qs

Event Driven Handouts 1 & 2

Event Driven Handouts 1 & 2

University

45 Qs

Quiz Informatika 1

Quiz Informatika 1

11th Grade - University

50 Qs

Python Functions Quiz

Python Functions Quiz

Assessment

Quiz

Computers

University

Hard

Created by

Vigneshwari S

FREE Resource

50 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following code? def greet(name): return "Hi " + name print(greet("Alex"))

Alex

Hi Alex

greet Alex

Error

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

If a function has no return statement, it returns:

0

None

Empty string

Error

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which keyword is used to define a function in Python?

func

def

function

define

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is a function call?

def myfunc()

myfunc()

function myfunc

func myfunc

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output? def add(a, b): return a + b print(add(2, 3))

23

5

(2, 3)

Error

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Positional arguments must be:

Passed in order

Always keyword arguments

Optional always

Declared after *args

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which function returns the length of a string?

size()

len()

count()

length()

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?