Python Basics
Python Basics
1, MADURAI
CLASS XI INFORMATICS PRACTICES
HALF YEARLY REVISION WORKSHEET
COMPUTER ORGANIZATION, BASICS OF PYTHON PROGRAMMING
1) Identify the valid identifiers from following: 13) What will be the output of the following
a) f@name b) as c) _tax , roll_no d) 12class a) print(type(5 / 2)) b)print(type(5 // 2))
e)totalmarks f) addr1 g) Subtotal h) 2number 14) Rewrite the following code using for:
2) Python is a/an ___________language. i = 10
a) High level b) Procedural while (i > 0) :
c) Machine language d) Difficult3) print (i)
3) Evaluate (to True or False) each of the following i -= 3
expression: 14<=14, 14 < 15, -15 >=15 15) Predict the output of following codes?
4) Which of the following is a valid identifier? a) if (4 + 5 == 10):
a) while b) is c) true d) break print("TRUE")
5) What will be the output of the following python else:
statements? print("FALSE")
a,b,c = 10,40,20 print("TRUE")
a,c,b = b+10, a+20, c-10 b) x=1
print(a,b,c) if x>3:
print(a+b//c**2) if x>4:
6) Python programs are typed in print("A", end=' ')
a) Interactive mode b) Script mode else:
c) A combination of interactive and script mode print("B", end=' ')
d) All of these elif x<2:
7) Predict output: if (x!=0):
sum = 0 print("C", end=' ')
for x in range(10): else:
sum = sum + x**2 print("D", end=' ')
print(sum) print("E")
8) Write the following arithmetic expressions using c) str(print()) + "One"
operators in Python: 16) Function range(3) is equivalent to :
a) range(1,3) b) range(0,3)
c) range(0,3,1) d) range(1,3,0)
17) For a while loop, an equivalent for loop can
9) Which of the following is correct? always be written(True/False)
a. Keywords can be used as a variable name. 18) If statement is a
a) Simple statement b) Empty statement
b. Variable name can start with a digit.
c) Compound statement d) Iterative statement
c. Variable name can start with an underscore. 19) Which data type will be used to represent the
d.Variable name can have symbols like: @, #, $ following data values and why?
10) Evaluate the following : a) Number of months in a year b) Resident of
a) not(1==1 and 0!=1) Delhi or not c) Volume of a sphere d) Name of the
b) not (True and False) or student
True) 20) Categorise the following as syntax error,
c) 10 and 50<10 logical error or runtime error:
d) 15<5 or 7>10 and 3>2 or not 5 a) 25 / 0
11) Write output of the following code: b) num1 = 25; num2 = 0;
for i in [4,3,2,1,0]: num1/num2
print("i", end=":") 21) Is Boolean is a subtype of integers?
12) How is a code block indicated in Python? 22) Python provides two categories of loop:
a) Brackets b) Indentation a) Counting b) Conditional
c) Entry controlled d) a & b without programmer’s intervention.
23) Which of the following can be used to create a) Type casting b) Explicit type conversion
comments? c) Coercion d) None of these
a) // b) # c) ''' d) All of these 40) If the user inputs 2, what does the following
24) The input returns the value as ______ type. code snippet print?
a) integer b) string x=float(input( ))
c) floating point d) None of these if x==1:
25) To print a line without ending it with a print(‘Yes’)
newline, _________argument is used with print(). elif x>=2:
a) sep b) newline c) end d) next print(‘Maybe’)
26) For two objects x and y, the expression x is y else:
will yield True, if and only if print(‘No’)
a) id(x) == id(y) b) len(x) == len(y) 41) If the value of a = 20 and b = 20, then a+=b
c) x == y d) all of these will assign ________ to a.
27) Which of the following is not an immutable a) 40 b) 30 c) 20 d) 10
type in Python? 42) Identify the string literals from the following:
a) String b) Tuples c) Dictionary d) Numbers 1. ‘abc’ 2. “Hello World” 3. “abc”
28) Which of the following is not an operating 4. Hello 5. ‘hello\world’ 6. StringName
system? a) 1 & 3 b) 1,2 ,3 & 5 c) 1, 3 , 5 & 6 d) 1 & 7
a) Windows b) Linux c) Oracle d) DOS 43) Identify the invalid Python statement.
29) In Python, a variable may be assigned a value a) a, b, c= 1, 2, 3 b) a, b, c = 1, ‘2’, 3
of one type, and then later assigned a value c) a=b=c=1 d) a=b=c=1, =2, =3
of different type. This concept is known as ----- 44) Data in computer terminology mean?
a) mutability b) static typing (a) Figure (b) Raw facts (c) Both a & b (d) None
c) dynamic typing d) immutability of these
30) What is the name of the component that is used 45) What is information?
to both read and write data? (a) Processed Data (b) Collection of a Program
a) ROM b) RAM c) Hard Drive d) Cache m/m (c) Raw Data (d) Collection of Instructions
31) Which operator has the lowest precedence? 46) MICR stands for?
a) not b) % c) and d) + (a) Maganetic Ink Character Reader (b) Maganetic
32)What is the value of expression 10 + 3 ** 3 * 2? Ink Code Reader (c) Maganetic Ink Caser Reader
a) 28 b) 739 c) 829 d) 64 (d) Maganetic Ink Computer Reader
33) What is the result of the expression 5 and 10 ? 47) An optical mouse uses
a) 5 b) 1 c) 10 d) 0 (a) Infrared light (b) Light emitting diode (LED)
34) Which of the following statements will make a (c) Sensor (d) Microwave
selection construct? 48) Smallest unit of computer memory ?
a) if b) if – else c) for d) a & b (a) Megabyte (b) Bit (c) Byte (d) Killo Byte
35) A disk fragmentor is an example of : 49) 1 TB is equivalent to –
a) Application software b) System software (a) 210 byte (b) 210 MB (c) 210 KB (d) 210 GB
c) Utility program d) None of these 50) Which of the following device can store more
36) To find the last element of a list named ‘smiles’ than 100 GB data?
in Python, _________ will be used ? (a) Floppy Disk (b) Compact Disk (c) DVD (d)
a) smiles [0] b) smiles[-1] Hard disk
c) smiles[lpos] d) smiles[:-1] 51) Which of the following memory is the fastest
37) Which of the following can add only one value memory to access data?
to a list ? (a) RAM (b) ROM (c) Register (d) Hard disk
a) add () b)append ( ) c)extend ( ) d) none of these 52) Arrange the following measurement units of
38) Which of the following can delete an element memory in ascending order as per their storage
from a list if the value is given ? caapcity? BYTE, MB, GB, KB
a) pop ( ) b) remove() c) del d) all of these (a) 1,2,3,4 (b) 4,3,2,1 (c) 1,4,2,3 (d) 1,4,3,2
39) Conversion performed by the compiler