wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

25-26 sII gI quiz exercise I

Total questions: 30

Worksheet time: 16mins

Name
Class
Date
1.

What is the output?

a)

5

b)

3

c)

8

d)

a+b

2.

What is the name of this function?

a)

add

b)

return

c)

def

d)

print

3.

What is the output?

a)

6

b)

3

c)

8

d)

10

4.

What is the name of this function?

a)

substract

b)

a

c)

b

d)

10

5.

What is the output?

a)

42

b)

7

c)

6

d)

10

6.

What is the output?

a)

4.0

b)

4

c)

20

d)

5

7.

What is the output?

a)

81

b)

18

c)

9

d)

a

8.

What is the output?

a)

10.0

b)

12

c)

8

d)

2

9.

What is the output?

a)

80.0

b)

90.0

c)

70.0

d)

0

10.

What is the output?

a)

My name and surname is John Smith

b)

My name and surname is name, surname

c)

My name and surname

d)

My name

11.

What is the output?

a)

The number is positive

b)

The number is negative

c)

The number is zero

d)

Nothing

12.

What is the error in this function?

a)

Missing colon

b)

Missing def

c)

Indentation

d)

Parameters

13.

What is the error in this function?

a)

Missing colon

b)

Missing def

c)

Indentation

d)

Parameters

14.

What is the error in this function?

a)

Missing colon

b)

Missing def

c)

Indentation

d)

Missing Parameter

15.

What is the error in this function?

a)

Missing colon

b)

Missing def

c)

Indentation

d)

Missing Parameter

16.

What is the output?

a)

The bigger number is: 8

b)

The bigger number is: 5

c)

The bigger number is: 87

d)

The bigger number is: 80

17.

What is the output?

a)

Negative

Positive or zero

b)

Positive

Positive or zero

c)

Negative

Positive or Negative

d)

Negative

18.

The function in python start with ?

(a)  

19.

Function in python should:

a)

Start with def

b)

have a name

c)

have bracket after name

d)

have a parameter

20.

Function in python should:

a)

Start with def

b)

have a name

c)

have bracket after name

d)

have a parameter

21.

After function is defined we have to add indentations?

a)

True

b)

False

22.

If there are two returns inside the function second return is executed?

a)

True

b)

False

23.

A function in Python is a named, self-contained block of reusable code that performs a specific task.

a)

True

b)

False

24.

What type of data is the following?: X = "195.67"

a)

Float

b)

String

c)

Boolean

d)

Integer

25.

What type of variable is the following?: Y = False

a)

Float

b)

String

c)

Integer

d)

Boolean

26.

What does the following Python program print?

X = "Hello World!"

Y = "I can code "

Z = " In Python"

print( X + Y + Z)

a)

Hello World! I can code In Python

b)

Hello World!I can code In Python

c)

Hello World! I can codeIn Python

d)

Hello World!I can code In Python

27.

float, integer, boolean, and string are all examples of what?

a)

Variables

b)

Data Types

c)

Words

d)

Concatenation

28.

Which character is used to give comments in python program?

a)

&

b)

@

c)

&

d)

#

29.

Which of the following is a correct variable name?

a)

11A

b)

Grade11#

c)

Com11

d)

my var

30.

Which of the following is a correct variable name?

a)

Act11

b)

11myvar

c)

quiz2$

d)

my-var