function in python

function in python

12th Grade

20 Qs

quiz-placeholder

Similar activities

Lecture Exercise Topic 1.3

Lecture Exercise Topic 1.3

12th Grade

21 Qs

Sustainable Developments Goals

Sustainable Developments Goals

6th - 12th Grade

17 Qs

Logika & Pemrograman (ID)

Logika & Pemrograman (ID)

10th Grade - Professional Development

20 Qs

Quiz ASJ

Quiz ASJ

12th Grade

20 Qs

4.6.4 Logic Gates

4.6.4 Logic Gates

10th Grade - Professional Development

15 Qs

quiz_G10

quiz_G10

12th Grade

20 Qs

Quiz1_12&11_2t_20214

Quiz1_12&11_2t_20214

12th Grade

20 Qs

Google

Google

7th - 12th Grade

20 Qs

function in python

function in python

Assessment

Quiz

Computers

12th Grade

Hard

Created by

Puneet Kohli

Used 79+ times

FREE Resource

20 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the default return value for a function that does not return a value explicitly?

None

int

double

null

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following items are present in the function header?

Function name only

Both function name and parameter list

parameter list only

Return value

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following keywords marks the begining of the function block?

Func

define

def

function

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the name given to that area of memory, where the system stores the parameters and local variables of a function call?

a heap

storage area

a stack

an array

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What Is The Output Of The Following Code Snippet?


def func(message, num = 1):

print(message * num)


func('Welcome')

func('Viewers', 3)

Welcome

Viewers

Welcome

ViewersViewersViewers

Welcome

Viewers,Viewers,Viewers

Welcome

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What Is The Output Of The Following Code Snippet?


def func(message, num = 1):

print(message * num)


func('Welcome')

func('Viewers', 3)

Welcome

Viewers

Welcome

ViewersViewersViewers

Welcome

Viewers,Viewers,Viewers

Welcome

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Fill in the line of code for calculating the factorial of a number.


def fact(num):

if num == 0:

return 1

else:

return _____________________

num*fact(num-1)

(num-1)*(num-2)

num*(num-1)

fact(num)*fact(num-1)

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