Standard: X: Chapter 8: PYTHON REVISION
Standard: X: Chapter 8: PYTHON REVISION
Keywords:
Print 3*2**2
a) 81 b) 18 c) 36 d) 12
a) 8>=8 b) False
c) True d) Error
i. Plain integers
ii. Boolean
iii. Long integers
iv. Complex Numbers
v. Floting-point Numbers
3) What are data types? What are Pythons built-in core data types?
4) What are literals in Python? How many types of literals are allowed
in Python?
Ans: Literals are constant i.e. the data items that never change their
a. String literals.
b. Numeric literals.
c. Special literal. None.
d. Boolean literals.
e. Literal collection called tuples list.
Application Oriented Questions
1) Aniket wants to double the value of 5 and raise
print5*2**2
Ans: a. 20
c. (5*2) **2
Ans: a) 5 5
b) print 11.0/2 , 11 |/2.
Keywords:
1. Suit-Block.
2. Block- A group of a consecutive statements having same
indentation level.
3. Body- The block of statements in a compound statement that
follows the header.
4. Infinite Loop- A Loop that never ends. Endless Loop.
5. Iteration statement- Looping statement.
6. Jump statement-Statement that unconditionally transfer
program control within a function.
7. Looping Statement- Iteration.
8. Empty Statement- A statement that appears in the code but
does nothing.
9. Nested Loop- A Loop that contains another Loop inside its
body.
10. Nesting-Same program-construct within another Loop inside
its body.
Objective Type Questions
1 .What is the output of following code?
While3>=3:
Print 3
a) 3 is printed once.
b) 3 is printed 3 times.
c) Error in code.
d) 3 is printed infinitely until program is closed.
for i in range(1,0):
print i
a) 0
b) 1
c) No output
d) Error in code
a) for b)while
c) iter d)repeat
a) { } c) identation
b) ( ) d) Quotation
1. For
2. While
If(4+5==0) :
print”TRUE”
else :
print”False”
print”TRUE”
Ans- FALSE
TRUE
4.Write python code to add the odd numbers up to a given value N and
print the result.
sum=0
i=1
while i<=N:
sum=sum+i
i=i+2
print sum
Python Programms(Practicals)
1. Write a python program to print squares of First 5 Natural
Numbers.
Ans. Num=1
while Num<=5;
Print Num*Num
Num=Num=1
Output:
16
25
Ans. sum=0
sum+=n
print “Sum of natural numbers <=”n,’is’,
sum
if num%2=0;
else
Output:
Enter a Number: 8
- 8 is Even Number
4. Write a program to read distance in miles and print in kilometers.
Kilometers=1.609*miles
Output: