0% found this document useful (0 votes)
57 views4 pages

Class - 11 PA (Test) IT 2 AUG.

This document contains a periodic test for a Python/IT class. It has 14 multiple choice and code-based questions testing Python concepts like data types, operators, strings, tuples, loops, conditionals, and dynamic typing. Students are asked to write code, compare values, analyze output, and identify errors. The test has a time limit of 2 hours and is out of 40 total marks.

Uploaded by

Indira Singh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
57 views4 pages

Class - 11 PA (Test) IT 2 AUG.

This document contains a periodic test for a Python/IT class. It has 14 multiple choice and code-based questions testing Python concepts like data types, operators, strings, tuples, loops, conditionals, and dynamic typing. Students are asked to write code, compare values, analyze output, and identify errors. The test has a time limit of 2 hours and is out of 40 total marks.

Uploaded by

Indira Singh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

PERIODIC TEST 1 DATE: 2/08/21

CLASS - 11
IT/CS-402
TIME : 2HOUR MM : 40
NAME: __________________________________________SEC. ____ ROLL NO.___

Every Question is Compulsory

1. When was Python released Explain its real time use? (2 Marks)
2. What are the advantages of Python programming language ? (2 Marks)
3. What are some limitations of Python programming language? (2 Marks)
4. What is cross-platform software? (2 Marks)
5. Python syntax for printing real time? (2 Marks)

6. From the following, find out which assignment statement will produce an error. State
reason(s) too. (2 Marks)
(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

7 . What will be returned by Python as result of following statements? (2 Marks)

(a)
>>> type(0)

(b)
>>>type(int(0))

(c)
>>>.type(int('0'))
(d)
>>> type('0')

(e)
>>>type(1.0)

(f)
>>>type(int(1.0))

(g)
>>>type(float(0))

(h)
>>>type(float(1.0))

(i)
>>>type(3/2)

8. What is the result of the following expressions? (2 Marks)

(a)
print ("""
1
2
3
""")

(b)
text = "Test. \nNext line."
print (text)

(c)
print ('One', 'Two' * 2)
print ('One' + 'Two' * 2)
print (len(' 0123456789'))
(d)
s = '0123456789'
print (s[3], s[0:3], '-', s [2:5])
print (s[:3], '-', s[3:], ',', s[3:100])
print (s[20:], s[2:1], s[1:1])

(e)
s = '987654321'
print (s[-1], s[-3])
print (s[-3:], s[:-3])
print (s[-100:-3], s[-100:3])

9. Write a program to input n numbers from the user. Store these numbers in a tuple.
Print the maximum and minimum number from this tuple. (4 MARKS)
10. Write a program which reverses a string and stores the reversed string in a new
string. (4 MARKS)
11. Write a program that prompts for a phone number of 10 digit and two dashes ,with
dashes after the area code and the next three numbers . (4 MARKS)
12. Display if the phone number entered is valid format or not and display if the phone
number is valid or not .
(4 MARKS)

Q.13A) Compare the tuples and write the output ?Total marks(4 MARKS)

(i) >>>tup1=(21,22,23)
>>>tup2=(21.0,22.0,23.0)
>>>tup1==tup2
(ii) >>>tup1=(‘DELHI’,’MUMBAI’,CHENNAI’)
>>>tup2=(‘Lucknow’,Haridwar’,’Dehradun’)
>>>tup1>tup2
B) How will you convert a string to an integer in python?
C) What is None literal in python?
D) Write the output of the following code. How many times will the following loop
iterate?
for j in “absolute”:
if j>=’t’:
break
print(j, end=’ ’)
Q.14 .A) What is dynamic typing in python? Explain with an example. Total marks (4
MARKS)

B) What is the output produced by the following code?


x=1
if x>3:
if x>4:
print('A',end='#')
else:
print('B',end='$' )
elif x<2:
if (x!=0):
print('C', end='@' )
print('D')

You might also like