Unit1 - Revision Paper PDF
Unit1 - Revision Paper PDF
b. X= “one”
Y= “two”
Count = 0
while count < len(x):
1. What is python?
2. What is a variable?
3. How can we declare variable in python?
4. What is a keyword?
5. When we write a statement like a,b,c,d =1,2,3,4 what does you call it
?- Multiple Assignment
6. How the ‘/’ operator is different from ‘%’ operator and ‘//’ operator?
7. Define unary, binary, ternary operators with example
8. What is data type?
9. Name the basic and sequence data type in python
10. Differentiate between floor() and ceil() function
11. Differentiate between sqrt () and pow() function
12. Define Looping statement with example
13. Find the output of the following codes:
a.
b. i=1
While i<5:
Print( i )
I=i*2
c. total = 0
sum1 = 0
for i range (0,10):
sum1 = sum1 + i
print(total)
d. a = 0
for i range (10):
a=a+1
print(a)
f. a=0
for i in range(10):
a=a+1
for j in range(10):
a = a+1
print(a)
16. Will the following code produce any result? Justify your answer?
X=”MyPython”
Y=2
print(X+Y)
17. What is dynamic data types? Give an example?
In python, the values that a variable has always hold a data type but
the variable itself has no strict type in its definition. You can reuse
the same variable to point to an object of a different type. This is
called dynamic type.
Eg:
>>>val = 10
>>> val
10
>>>val=’ten’
>>>val
‘ten’ -> here variable val is dynamic data type.