python functions

python functions

10th Grade

33 Qs

quiz-placeholder

Similar activities

10 Brahamadik 1st term

10 Brahamadik 1st term

10th Grade

30 Qs

Lesson three (Collecting projects data using spreadsheets )

Lesson three (Collecting projects data using spreadsheets )

10th Grade

28 Qs

Exploring the world wide web

Exploring the world wide web

7th - 12th Grade

28 Qs

Programming Techniques

Programming Techniques

8th - 10th Grade

30 Qs

COMPUTER 3

COMPUTER 3

3rd Grade - University

30 Qs

Nat 5 Computer Systems Revision

Nat 5 Computer Systems Revision

9th - 10th Grade

36 Qs

he

he

8th - 10th Grade

38 Qs

Sumatif 1 - Bab Sistem Komputer

Sumatif 1 - Bab Sistem Komputer

10th Grade

33 Qs

python functions

python functions

Assessment

Quiz

Computers

10th Grade

Hard

Created by

Kasun Jayasekara

Used 11+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

33 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

Access all questions and much more by creating a free account

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

Already have an account?

Discover more resources for Computers