Page 79 - Information_Practice_Fliipbook_Class11
P. 79
(ii) Identify the name of the variable.
(iii) What is the data associated with 'yes'?
9. How can you assign the same value to multiple variables in Python? Illustrate with suitable example(s).
10. What will be the output produced by the Python interpreter on the execution of the following Python code in the Python
shell?
>>> n1, n2 = 4, 5
>>> product, diff = n1*n2, n1-n2
>>> print(product)
>>> print(product, diff)
11. Will the execution of the following statements in an interactive environment (say, IDLE) produce an output? Justify your
answer.
>>> value = 8
>>> q = value/4
12. Will the execution of the following statements in an interactive environment (say, IDLE) produce an output? Justify your
answer.
>>> value = 'eight'
>>> product = value*3
>>> print(product)
13. Will the execution of the following statements in an interactive environment (say, IDLE) produce an output? Justify your
answer.
>>> value = 'four'
>>> value = value/2
>>> print(value)
14. What is a comment? How is it different from other statements in Python?
15. What is the purpose of sep and end clauses while invoking the print() function?
16. Give an example of each of the following:
(i) a single-line comment
(ii) a multiline comment
17. Write a Python statement to print a blank line.
18. What are the rules for writing a comment in a Python program?
19. What is the purpose of comments in a Python program?
E. Lab Exercise Questions
1. Write a program to accept the name and age of a user and display it in the following format:
Name: Abeer
Age: 6
2. Write a program to accept city and state from the user and display them in different lines using a single print statement.
3. Write a program to accept the side of a cube and display its volume.
4. Write a program to accept and display your school's name and address in the following format:
School Name:
Address :
Assertion and Reasoning Based Questions
The following questions are assertion(A) and reasoning(R) based. Mark your answer as
a. Both A and R are true and R is the correct explanation of A
b. Both A and R are true and R is not the correct explanation of A
c. A is true but R is false
d. A is false but R is true
Basics of Python Programming 65

