7 UI3 Worksheet 1 Anserkey
7 UI3 Worksheet 1 Anserkey
Q1. Choose the correct option and write the justification to support your answer.
The if statement is used to check a condition, and if the condition is true, it executes the block of code. It
is used when we have to evaluate only one condition
Syntax:
if <condition>:
Statement 1
Statement 2
3. What is the use of the input () function in python? Explain with the help of example.
The input() function is used to receive input from the user during the program’s execution. It is an
optional string or prompt displayed to the user. Example:
1. Write a Python program to add three numbers. (Take input from the user)
3. Write a Python program to take a string input from the user and print it five times.