Font size
WorksheetsPROG3 - Chapter 2
Total questions: 28
Worksheet time: 16mins
The + (plus) sign, when applied to two strings, becomes a _________ operator.
concatenation
replication
addition
Concatenation simply concatenates (glues) two strings into one.
True
False
In contrast to its arithmetic sibling, the concatenation operator is not __________, i.e., "ab" + "ba" is not the same as "ba" + "ab".
commutative
multiplicative
additive
If you want the + sign to be a concatenator, not an adder, you must ensure that both its arguments are integers.
True
False
The * (asterisk) sign, when applied to a string and number, becomes a __________ operator.
concatenation
replication
multiplication
In replication operator (*), a number less than or equal to zero produces an empty string.
True
False
An ____________ is a symbol of the programming language, which is able to operate on the values.
operator
asterisk
plus
Multiplication operator.
*
/
//
%
Divisional operator.
*
/
//
%
Is an integer divisional operator.
The results are always rounded.
*
/
//
%
Modulo.
Remainder left after the integer division.
*
/
//
%
Binary: 2 arguments (1 + 2)
Unary: 1 argument (-4)
True
False
What can a function do?
Cause some effect
Evaluate a value and return it as the function's result
Write the program
Make program faster
Where do functions come from?
Python itself
Python's add-ons named modules
Write them yourself
System Software
The name of the function should be ________ (the name of the print function is self-evident).
significant
long
unrelated
A function may have:
effect
result
arguments
placeholders
Python functions strongly demand the presence of __________ - opening and closing ones, respectively.
a pair of parentheses
a pair of brackets
a pair of braces
a pair of commas
If you want to deliver one or more arguments to a function, you place them inside the parentheses.
True
False
The function name along with the parentheses and argument(s), forms the ____________.
function_name(arguments)
function invocation
function instruction
function code
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;
True
False
The ______ function is able to read data entered by the user and to return the same data to the running program.
input()
print()
read()
retur()
Virtually all programs read and process data.
True
False
A program which doesn't get a user's input is a _____ program.
deaf
blind
mute
broken
You must use the result of a function as an argument of any arithmetic operation, since it returns string.
True
False
The process of converting the value of one data type (integer, string, float, etc.) to another data type is called ____________.
Type conversion
Type change
Type converting
Python automatically converts one data type to another data type.
Implicit
Explicit
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.
Implicit
Explicit
Explicit Type Conversion is also called ___________ because the user casts (changes) the data type of the objects.
typecasting
typechanging
type converting
