AS_WB_CB_VI_CS_Introduction to Python
AS_WB_CB_VI_CS_Introduction to Python
Introduction to Python
ii. You have to create a program that calculates and displays the [Ap
]
sum of three numbers. The program prompts the user to enter
the numbers. Which mode of Python would be most suitable
for developing this program?
iii. You have to develop a program to greet users by name and [Ap
]
let them know the current temperature. The current
temperature is stored in a variable ‘temp’. Which print
command would be most suitable for displaying the message?
Pg no. 1
7. Introduction to Python
a. .src b. .py
c. .code d. .pyc
a. # b. $
c. % d. &
i.
ii.
iii.
Pg no. 2
7. Introduction to Python
iii. Explain why you cannot use a value input by a user directly [Ap
]
in mathematical calculations. What do you need to do to use
them for calculations?
Pg no. 3
7. Introduction to Python
Lab Activity
Q.1 Write a program that asks the user for his/her name, stores [Ap
. the name in a variable and then displays ‘Hello’ along with ]
Q.2 Write a Python program that accepts the base and height [Ap
. from the user and calculates the area of a triangle. ]
Pg no. 4
7. Introduction to Python
An
s:
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Pg no. 5