PYTHON (Functions)

PYTHON (Functions)

6th Grade

10 Qs

quiz-placeholder

Similar activities

Milestone Exkul SMP SMA - Q5_2022_Basic Python Syntax

Milestone Exkul SMP SMA - Q5_2022_Basic Python Syntax

6th - 8th Grade

15 Qs

Scope of Variables in Python

Scope of Variables in Python

1st Grade - Professional Development

15 Qs

Python Класи, наслідування

Python Класи, наслідування

6th - 10th Grade

9 Qs

Calculator

Calculator

2nd - 8th Grade

15 Qs

While loop

While loop

3rd Grade - University

9 Qs

Penggunaan Pernyataan Function (4.2.2)

Penggunaan Pernyataan Function (4.2.2)

3rd Grade - University

10 Qs

Python Quiz  -  5

Python Quiz - 5

4th - 11th Grade

10 Qs

Functions in Python

Functions in Python

6th - 8th Grade

10 Qs

PYTHON (Functions)

PYTHON (Functions)

Assessment

Quiz

Computers

6th Grade

Medium

Created by

Fazla Fairooz

Used 67+ times

FREE Resource

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which keyword is used for functions?

func

def

define

function

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of this program?


def addOne(number):

number += 1

return number

one = addOne(0)

two = addOne(one)

print(two)

0

1

2

3

4

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of this program?


def hello():

print(“I am a beginner”)

hello()

hello()

I am a beginner

I am a beginner I am a beginner

Hello

Hello

Hello

I am a beginner

I am a beginner

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

When a variable is inside of a function what do you call its scope?

Static

Local

Global

Boolean

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of a function?

They are reusable pieces of programs.

They are required by the Python

They allow us to compile our program

They make the program larger

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is missing in the following code?


def sumA(count):

a = count+1

return a

print(a)

The initialization of variable a

A function call

The declaration of the global variable a

The print statement inside the function

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of this program?


def printmessage(message, ntimes = 1):

print(message * ntimes)

printmessage(“Hello”)

printmessage(“Hello”, 5)

Hello

Hello Hello 5

Hello Hello

Hello

HelloHelloHelloHelloHello

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?