Page 63 - tp_Modula_v2.0
P. 63
Periodic Assessment-2
(Based on chapters 4 & 5)
A. What will be the output of the following Python codes:
1. i = 0
while (i == 0):
print("Hello Touchpad")
2. def info(name, age):
"This will print the passed
information into the function"
print("Name: ", name)
print("Age: ", age)
return
#Now print information function is called
info(age=21, name="Taarush")
B. Write a program to add first five natural numbers by using the while loop.
C. Define the following:
1. Parameters ……………………………………………………………………………………………………………………………...
2. built-in functions ……………………………………………………………………………………………………………………
3. Infinite loop …………………………………………………………………………………………………………………………….
4. range() Function ……………………………………………………………………………………………………………………..
Periodic Assessment-2 61

