Class 11 CS Ch-7 Python Findamentals
Class 11 CS Ch-7 Python Findamentals
CHAPTER-PYTHON FUNDAMENTALS
MIND MAP
Python
Other characters:-
Unicode Variable:
Variable is a name given to a
memory location. A variable can
consider as a container which
holds value.
1. VERY SHORT ANSWER QUESTIONS:
1. What are tokens in Python? How many types of tokens are allowed in Python ?
2. What are tokens in Python? How many types of tokens are allowed in Python ?
3. What are literals in Python? How many types of literals are allowed in Python ?
4. Can nongraphic characters be used in Python? How? Give examples
5. Which of these is not a legal numeric type in Python? (a) int (b) float (c) decimal.
1. Write a program that displays a joke. But display the punchline only when the user presses
enter key.
(Hint. You may use input())
2. Write a program to read today's date (only del part) from user. Then display how many days
are left in the current month.
3. "Comments are useful and easy way to enhance readability and understandability of a
program." Elaborate with examples.
4. What is Dynamic Typing feature of Python ?
5. Write a program that generates the following output :
5
10
9
Assign value 5 to a variable using assignment operator (=) Multiply it with 2 to generate 10
and subtract 1 to generate 9.
1. From the following, find out which assignment statement will produce an error. State
reason(s) too.
(a) x = 55
(b) y = 037
(c) z = 0o98
(d) 56thnumber = 3300
(e) length = 450.17
(f)! Taylor = 'Instant'
(g) this variable = 87. E02
(h) float = .17E - 03
(i) FLOAT = 0.17E - 03
1. Consider below given two sets of codes, which are nearly identical, along with their execution in
Python shell. Notice that first code-fragment after taking input gives error, while second code-
fragment does not produce error. Can you tell why ?
(a)
>>> print(num = float(input("value1:")) )
value1:67
67.0
2. The id( ) can be used to get the memory address of a variable. Consider the adjacent code and tell
if the id( ) functions will return the same value or not(as the value to be printed via print() ) ? Why
?
[There are four print() function statements that are printing id of variable num in the code shown
on the right.
num = 13
print( id(num) )
num = num + 3
print( id(num) )
num = num - 3
print( id(num) )
num = "Hello"
print( id(num) )
Ans1 1. 2. 3. 4. 5.
MCQ C A D A,B C,D
6. 7. 8. 9. 10.
B,C B B B C
One Word Keyword Identifier Literals Operator Expression