wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

PROG3 - Chapter 2

Total questions: 28

Worksheet time: 16mins

Name
Class
Date
1.

The + (plus) sign, when applied to two strings, becomes a _________ operator.

a)

concatenation

b)

replication

c)

addition

2.

Concatenation simply concatenates (glues) two strings into one.

a)

True

b)

False

3.

In contrast to its arithmetic sibling, the concatenation operator is not __________, i.e., "ab" + "ba" is not the same as "ba" + "ab".

a)

commutative

b)

multiplicative

c)

additive

4.

If you want the + sign to be a concatenator, not an adder, you must ensure that both its arguments are integers.

a)

True

b)

False

5.

The * (asterisk) sign, when applied to a string and number, becomes a __________ operator.

a)

concatenation

b)

replication

c)

multiplication

6.

In replication operator (*), a number less than or equal to zero produces an empty string.

a)

True

b)

False

7.

An ____________ is a symbol of the programming language, which is able to operate on the values.

a)

operator

b)

asterisk

c)

plus

8.

Multiplication operator.

a)

*

b)

/

c)

//

d)

%

9.

Divisional operator.

a)

*

b)

/

c)

//

d)

%

10.

Is an integer divisional operator.

The results are always rounded.

a)

*

b)

/

c)

//

d)

%

11.

Modulo.

Remainder left after the integer division.

a)

*

b)

/

c)

//

d)

%

12.

Binary: 2 arguments (1 + 2)

Unary: 1 argument (-4)

a)

True

b)

False

13.

What can a function do?

a)

Cause some effect

b)

Evaluate a value and return it as the function's result

c)

Write the program

d)

Make program faster

14.

Where do functions come from?

a)

Python itself

b)

Python's add-ons named modules

c)

Write them yourself

d)

System Software

15.

The name of the function should be ________ (the name of the print function is self-evident).

a)

significant

b)

long

c)

unrelated

16.

A function may have:

a)

effect

b)

result

c)

arguments

d)

placeholders

17.

Python functions strongly demand the presence of __________ - opening and closing ones, respectively.

a)

a pair of parentheses

b)

a pair of brackets

c)

a pair of braces

d)

a pair of commas

18.

If you want to deliver one or more arguments to a function, you place them inside the parentheses.

a)

True

b)

False

19.

The function name along with the parentheses and argument(s), forms the ____________.

function_name(arguments)

a)

function invocation

b)

function instruction

c)

function code

20.

How a function works:

1. Python checks if the name specified is legal.

2. Python checks if the function's requirements for the number of arguments allows you to invoke the function in this way.

3. Python leaves your code for a moment and jumps into the function you want to invoke. (It takes your argument(s) too)

4. the function executes its code, causes the desired effect (if any), evaluates the desired result(s) (if any) and finishes its task;

a)

True

b)

False

21.

The ______ function is able to read data entered by the user and to return the same data to the running program.

a)

input()

b)

print()

c)

read()

d)

retur()

22.

Virtually all programs read and process data.

a)

True

b)

False

23.

A program which doesn't get a user's input is a _____ program.

a)

deaf

b)

blind

c)

mute

d)

broken

24.

You must use the result of a function as an argument of any arithmetic operation, since it returns string.

a)

True

b)

False

25.

The process of converting the value of one data type (integer, string, float, etc.) to another data type is called ____________.

a)

Type conversion

b)

Type change

c)

Type converting

26.

Python automatically converts one data type to another data type.

a)

Implicit

b)

Explicit

27.

Users convert the data type of an object to required data type.

We use the predefined functions like int(), float(), str(), etc to perform this type of conversion.

a)

Implicit

b)

Explicit

28.

Explicit Type Conversion is also called ___________ because the user casts (changes) the data type of the objects.

a)

typecasting

b)

typechanging

c)

type converting