0% found this document useful (0 votes)
78 views8 pages

XIInfo Pract PT2406

This document contains a sample paper with 5 sections (A to E) testing Python programming knowledge. Section A contains 18 multiple choice questions worth 1 mark each. Section B contains 7 short answer questions worth 2 marks each requiring examples. Section C contains 5 short answer questions worth 3 marks each. Section D contains 2 questions worth 4 marks each. Section E contains 3 questions worth 5 marks each requiring Python code. All questions must be answered using Python.

Uploaded by

Neelima Vijayan
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)
78 views8 pages

XIInfo Pract PT2406

This document contains a sample paper with 5 sections (A to E) testing Python programming knowledge. Section A contains 18 multiple choice questions worth 1 mark each. Section B contains 7 short answer questions worth 2 marks each requiring examples. Section C contains 5 short answer questions worth 3 marks each. Section D contains 2 questions worth 4 marks each. Section E contains 3 questions worth 5 marks each requiring Python code. All questions must be answered using Python.

Uploaded by

Neelima Vijayan
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/ 8

SAMPLE PAPER

__________________________________________________________________________________
General Instruction:
1. This question paper contains five sections, Section A to E.
2. All questions are compulsory.
3. Section A have 18 questions carrying 01 mark each.
4. Section B has 07 Very Short Answer type questions carrying 02 marks each.
Mention examples for each selected question.
5. Section C has 05 Short Answer type questions carrying 03 marks each.
6. Section D has 02 questions carrying 04 marks each.
7. Section E has 03 questions carrying 05 marks each.
All programming questions are to be answered using Python Language only

SECTION A – 18 MARKS

Q1. Python code can run on a variety of platforms, it means 1


Python is a _____ language.

(a) Graphical (b) Cross-platform

(c) independent (d) all of these

Q2. Data items having fixed value are called _____. 1

(a) Identifiers (b) functions

(c) Keywords (d) literals

Q3. Which Python built-in function returns the unique number 1


assigned to an object?

(a) identity() (b) id()

(c) refnum() (d) ref()

Q4. Escape sequences are treated as _____. 1

(a) strings (b) characters

(c) integers (d) none of these

Q5. Which of the following is not an immutable type in Python? 1

(a) String (b) Tuples

(c) dictionary (d) None of these

Q6. The _____ mode of Python gives instant result of typed 1


statement.

(a) Interactive mode (b) Script mode

(c) Combination of interactive and (d) All of these


script modes

Page 1 of 8 / XIC./IP./ 14 COPIES


Q7. What is the value of the expression 100/25 ? 1

(a) 4 (b) 4.0

(c) 2.5 (d) none of these

Q8. Which of the following is an escape sequence for a newline 1


character?

(a) \a (b) \t

(c) \n (d) \b

Q9. The _____ construct repeats a set of statements a specified 1


number of times or as ng as a condition is true.

(a) selection (b) repetition

(c) sequence (d) flow

Q10. To print the value of a variable, Python uses 1

(a) Print statement (b) Print() function

(c) print statement (d) print() function

Q11. Function range(3) is equivalent to : 1

(a) range(1, 3) (b) range(0, 3) (c) range(1, 3, 0) (d) None of


these

Q12. In Python, which of the following will create a block in a 1


compound statement?

(a) colon (b) statements indented at a lower,same level

(c) indentation in (d) { }


any form

Q13. To convert the read value through input() into a floating point 1
number, _____ () is used.

(a) floating (b) float

(c) int (d) integer

Q14. What does the following Python program display? 1

x=3

if x == 8:

print ("Am I here?", end = '')

elif x == 3:

Page 2 of 8 / XIC./IP./ 14 COPIES


print("Or here?", end = "")

else:

pass

print ("Or over here?")

(a) Am I here? (b) Or here?

(c) Am I here? Or here? (d) Or here? Or over here?

Q15. If the user inputs: 2, what does the following code snippet 1
print ?

x = float(input())

if(x == 1):

print("Yes")

elif (x >= 2):

print("Maybe")

else:

print ("No")

(a) Yes (b) No

(c) Maybe (d) Nothing is printed

Q16. Python is a/an _____ language. 1

(a) High level (b) difficult

(c) procedural (d) None of these

Q17 and 18 are ASSERTION AND REASONING based questions. Mark the
correct choice as

i. Both A and R are true and R is the correct explanation


for A

ii. Both A and R are true and R is not the correct


explanation for A

iii. A is True but R is False

iv. A is false but R is True

Q17. Assertion: In Python, blocks are represented through 1


indentation

Page 3 of 8 / XIC./IP./ 14 COPIES


Reasoning: Blocks in Python, are the compound statement

Q18. Assertion: Python’s pass statement is an empty statement 1

Reasoning: An empty statement does nothing

SECTION B – 14 MARKS

Q19. How are floating constants represented in Python? Mention 2


examples of each type.

OR

What is the basic difference between implicit type conversion


and explicit type conversion? Mention example of each.

Q20. What is an expression and a statement? 2

Q21. How does a conditional expression affect the result of if 2


statement?

Q22. What is Dynamic Typing feature of Python? Mention example. 2

Q23. What are augmented assignment operators? How are they 2


useful

Q24. What is the significance of break and continue statements? 2

Q25. Find output of the following: 2

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")

SECTION C – 15 MARKS

Q26. Find an output of the following code: 3

Page 4 of 8 / XIC./IP./ 14 COPIES


a) for x in range (5):

print (x)

b) for p in range(1, 10) :

print (p)

c) for q in range (100, 50, -10) :

print (q)

OR

Predict an output of the following code:

a) x = 10

y=0

while x > y :

print (x, y)

x=x-1

y += 1

b) count = 0

while count < 10 :

print ("Hello")

count += 1

Q27. "Comments are useful and easy way to enhance readability 3


and understandability of a program.” Elaborate with
examples.

Q28. What are three internal key-attributes of a value-variable in 3


Python Explain with example.

Q29. What do you mean by token in Python? How many types of 3


tokens are allowed in Python?

OR

Page 5 of 8 / XIC./IP./ 14 COPIES


What factors guide the choice of identifier in program?

Q30. What is the similarity and difference between for and while 3
loop? Mention example of each to support your answer.

SECTION D – 8 MARKS

Q31. i) How does the // operator different from the / 4


operator?
[2+2]
ii) What are the error types? Which error is very
difficult to locate?

Q32. i) Write the following mathematical expression in 4


terms of Python expression.
[2+2]
1
i) 3 𝑏 h
2
ii) πr2h

ii) Predict an output of the following code fragment:

x,y=20,60

y, x, y=x, y-10, x+10

print(x,y)

OR

i) Predict an output of the following code fragment:

x=40

y=x+1

x=20,y+x

print(x,y)

ii) Write following mathematical expression in terms of


Python expression.
𝟒
i) 𝟑 𝝅𝒓𝟑 ii) 2πr

SECTION E – 15 MARKS

Q33. i) Write a program to accept percentage from the user 5


and display the grade according to the following [3+2]
criteria:

Page 6 of 8 / XIC./IP./ 14 COPIES


Marks Grade

More than 90 A

Between 80 & 90 B

Between 60 & 80 C

Below 60 D

ii) Write a program to input a number and print its first


five multiplies.

OR

i) Write a program to calculate the Electricity Bill

(accept no of unit consumed from user) according to

the following criteria:

Unit Price

First 100 units No charge

Next 100 units Rs. 5 per unit

Next 200 units Rs. 10 per unit

(For example is unit is 350 then total bill amount is 2000)

ii) Write a program to find the sum of two numbers

Q34. i) Write a program to obtain temperature of 7 days 5


(Monday, Tuesday…. Sunday) and then display average
temperature of the week. [3+2]

ii) Write a program to find the area of square.


(Hints: Area= side*side)

Q35. i) Write a program to accept the cost price of a bike and 5


display the road tax to be paid according to the
following criteria: [3+2]

Cost Price Tax

More than 100000 15%

50000 – 100000 10%

Less than Equal To 50000 5%

Page 7 of 8 / XIC./IP./ 14 COPIES


ii) Write a program to find the simple interest based
principal amount, rate and time (Hints: Simple
Interest= (principal amount*rate*time)/100)

OR

i) Write a program that asks a user for a number of years,


and then prints out the number of days, hours, minutes
and seconds in that number of years.

How many years? 10

10.0 years is:

3650.0 days

87600.0 hours

5256800:0 minutes

315360000.0 seconds

ii) Write a program that reads a number of seconds and


print it in forms: mins And second ,

eg. , 200 second are printed as 3 mins and 20 second .

Page 8 of 8 / XIC./IP./ 14 COPIES

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy