Professional Documents
Culture Documents
ITS62604 Tutorial 5 (Answer)
ITS62604 Tutorial 5 (Answer)
5. What are built-in functions, and give an example of one that Python provides?
7. Explain what happens when the following recursive function is called with the value
4 as an argument:
8. Explain what happens when the following recursive function is called with the value 4
as an argument:
As a result, this code will lead to an infinite recursion, and it will keep printing the value 4
indefinitely until the program is forcibly terminated.
9. Explain what happens when the following recursive function is called with the values "hello"
and 0 as arguments:
Fatin Nabila
TUTORIAL 5
a) `8`
b) `0 1 4 9`
c) `24`
d) Hello, World!
NameError: name 'message' is not
defined
Fatin Nabila
TUTORIAL 5
e) 6
20
f) (8, 7)
g) "emp"
"salary"
h) "Emma 25".
i) 15
Fatin Nabila
TUTORIAL 5
j) 30.
error to print num
k) 15.
15.
11. Choose the correct function declaration of fun1() so that we can execute the following
function call successfully.
12. Given the following function fun1(), select all the correct function calls.
Fatin Nabila