Page 114 - Dig_CodeAI_V2.1_Class_8
P. 114
Periodic Assessment 3
(Based on chapters 6 to 8)
A. What will be the output of the following Python codes:
1. i = 0
while (i == 0):
print("Hello Workspace")
2. def info(name, age):
'''This will prints a passed
information into the function'''
print("Name: ", name)
print("Age: ", age)
return
#Now info() function is called
info("Taarush", 21)
B. Write a program to verify a password entered by the user by using the while loop. If the user enters
an incorrect password, then display the message "Incorrect password. Try again." until the correct
password is not entered; otherwise, display "Correct password. Access granted!".
C. Define the following:
1. Built-In Functions
2. Controller
3. Sensors
112 DigiCode AI (Ver. 2.1)-VIII

