Functions - Programming 1 Fawaz

Functions - Programming 1 Fawaz

10th Grade

19 Qs

quiz-placeholder

Similar activities

Python Basics Quiz

Python Basics Quiz

6th - 10th Grade

15 Qs

Python basics

Python basics

7th - 10th Grade

18 Qs

GCSE Computing - Subprograms

GCSE Computing - Subprograms

9th - 10th Grade

14 Qs

Python - Loops & Lists

Python - Loops & Lists

7th - 11th Grade

15 Qs

Functions in Python

Functions in Python

9th - 12th Grade

16 Qs

Subroutines

Subroutines

9th - 11th Grade

16 Qs

Python Programming Quiz

Python Programming Quiz

9th Grade - University

20 Qs

AQA GCSE Computer Science - 3.2.10 Subroutines

AQA GCSE Computer Science - 3.2.10 Subroutines

8th - 10th Grade

20 Qs

Functions - Programming 1 Fawaz

Functions - Programming 1 Fawaz

Assessment

Quiz

Computers, Education

10th Grade

Hard

function, basics

Standards-aligned

Created by

Mahi Mukati

FREE Resource

19 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What is the output of the following piece of code?


def test(i,j):

if(i==0):

return j

else:

return test(i-1,i+j)


print(test(4,7))

13

7

Infinite Loop

17

2.

MULTIPLE SELECT QUESTION

30 sec • 1 pt

Which of the following function calls can be used to invoke the below function definition?


def test(a,b,c,d)

test(1,2,3,4)

test(a=1,2,3,4)

test(a=1,b=2,c=3,4)

test(a=1,b=2,c=3,d=4)

3.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

Pick one from the following statements to correctly complete the function body to get the output 5 in the given code snippet:


def f(number):

#missing function body


print(f(5))

return "number"

print(number)

print("number")

return number

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

what is a variable defined inside all the function referred to as?

A static variable

A global variable

A local variable

An automatic variable

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

what is a variable defined outside all the function referred to as?

A static variable

A global variable

A local variable

An automatic variable

6.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Media Image
What will print?
nothing
5
6
an error message

7.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Media Image
What will print?
nothing
5
6
an error message

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?