Font size
WorksheetsPython Functions
Total questions: 9
Worksheet time: 5mins
The output of the code above will be
0
1
99
How to add these two numbers
age = int(age_1) + int(age_2)
age = int(age_1 + age_2)
age = age_1 + age_2
The string enclosed in triple quotes is called the doc string. It is used to
Show the documentation about the function
be read by the developer reading the function code
Which of the following code is true
square() will return 25
square(3) will return 9
Which of the following is true
The code above will result in syntax error
square(2,2) will result in a value of 4
square(2,3) will result in a value of 9
The above code is the signature of the print function in Python.
*objects represents
Variable number of arguments that can be passed as strings
pointer to objects in memory
The code above
Takes in variable number of arguments and returns the sum of them
Takes in a pointer to a list of numbers and returns the sum of them
The output of the code above is
<class 'tuple'>
<class 'list'>
<class 'dict'>
<class 'string'>
<class 'iterable'>
The output of the code above is
40
30
syntax error
