Python Paper1
Python Paper1
1
1
What must be the value of x for which the above diagram is accurate?
a. 1 b. 0 c. both a and b
5. 1 KB of data is equivalent to 1
a. 1024 bits b. 220 bytes c. 2-10 Mb d. 213 bits
6. IDLE stands for 1
a. Information Development Logic Environment
b. Interaction Development Logic Environment
c. Integrated Development and Learning Environment
d. Interaction Developer and Logic Environment
7. The following code produces an error: 1
a=int(input(‘Enter a number’))
c=a+b print(b)
What is the name of the error?
a. Name Error b. Undefined Error c. Type Error d. Syntax Error
8. Select the correct output for the following code: 1
L=[]
for i in range(1,10):
if i%2==0:
L.append(i)
print(L,end=’’)
a. [2,4,6,8]
b. [2 4 6 8 10]
c. [1 2 3 4 5 6 7 8 9]
d. [2 4 6 8]
9. Fill in the blank: 1
_______ function is used to create an empty tuple.
a. len() b. tuple() c. tup() d. T()
10. Which of the following is not a browser? 1
a. Google Chrome b. Microsoft Edge c. Mozilla Firefox d. Windows Explorer
11. Which of the following is a wrong pair of application and category? a. 1
WhatsApp: General Purpose software
b. Gmail: Customised software
c. Python: Free and Open-Source software
d. MS Word: Proprietary software
12. Fill in the blank 1
__________ is a language translator which reads a program line-by-line when run.
a. Compiler b. Assembler c. Transmitter d. Interpreter
13. Which of the following is true for Secondary memory? 1
a. It is faster than Primary memory
b. It is directly accessed by the CPU
c. It is faster than RAM
d. It is a non-volatile memory
14. The base values of binary, octal and hexadecimal are a. 1
10, 80 and 160 respectively.
b. 4, 8 and 16 respectively.
c. 2, 8 and 16 respectively.
d. 1, 8 and 16 respectively.
15. Ram was asked to write an essay on World Environment Day; He copied Preeti’s project and submitted it 1
the next day. What type of violation of IPR did Ram commit? a. Plagiarism
b. Copyright infringement
c. Trademark infringement
d. All of the above
16 Ram wanted to make a program which takes in two numbers from the user and print the two numbers as 1
shown below:
Input: Enter number 1=>23
Enter number 2=>24
Output: 23.0,24.0
He wrote the following code but doesn’t know what the last line is supposed to be
a=float(input(‘Enter number 1=>’))
b=float(input(‘Enter number 2=>’)) ...
What would be the last line of his code which produces his desired output?
a. print(a+b)
b. print(a,b)
c. print('a', ', ', 'b')
d. print(a,b,sep=', ')
The following questions 17 and 18 are Assertion-Reasoning based, answer the questions by choosing
one of the following responses:
a. Both A and R are true and R is the correct explanation of A.
b. Both A and R are true but R is not the correct explanation of A. c. A is true
but R is false.
d. A is false but R is true.
18. A: It is legal to download and watch movies online for free without the consent of the owner. R: 1
Use of proprietary software for free without the consent of the owner is a form of piracy.
SECTION – B 14
19. Rewrite the following operations in a syntax followed by Python: 2
a. 2
23
− ( ×3) b. 17 ×347
24
OR
Evaluate the following operations as a Python interpreter would: a.
2//3*6+9 b. (2+2)**(2-1)/2
20. Khaled wrote the following code to input a number and check whether it is a prime number or not. His code 2
is having errors. Rewrite the correct code and underline the corrections made.
n=int(input("Enter number to check=")
for i in range (2, n//2):
if n%i=0:
print(Number is not prime)
break else:
print("Number is prime’)
23. You are planning to go for a vacation. You surfed the Internet to get answers for the following queries: 2
1. Weather conditions in Mumbai
2. Availability of air tickets and fares from Dimapur to Mumbai
Give one reason each of how these search queries may have created a digital footprint of you.
OR
After practicals, Arbhav left the computer laboratory but forgot to sign off from his email account. Later his
classmate Revaan started using the same computer. He is now logged in as Arbhav. He sends rude and
inappropriate emails to few of his classmates using Arbhav’s email account. Revaan’s activity is an example
of which of the following cyber-crime? Justify your answer. a) Hacking
b) Identity Theft
c) Cyber Bullying
d) Plagiarism
SECTION – C 15
26. Review the following code: 3
1. dict={“Name”:’Aman’,”Class”:7}
2. keys.dict()=A
3. values.dict()=B 4.
from i,j in A,B:
5. print(A,B,sep=,)
6. print(‘dict’)
Identify the errors, rewrite the code and name the number of line where corrections were made.
27. a) Predict the output of the following code: 1
tuple1 = (11, 22, 33, 44, 55 ,66)
list1 =list(tuple1) new_list = []
for i in list1: if i%2==0:
new_list.append(i) new_tuple
= tuple(new_list) print(new_tuple)
b) Write a program to find and print the grade of a student when the user inputs their percentage.
Grades are allocated as given in the table below:
Percentage of Marks Grade
Above 90% A 1
80% to 90% B
70% to 80% C
60% to 70% D
Below 60% E
28. a) Write a python program to find out the greater of two user defined numbers. 1
ii. (a,b)=(10,5)
print(a/b)
print(a//b) print(a
%b)
print(a**2)
v. a=20 b=10
a//=b
print(c+2/2)
33. Write a program that prints a user defined number of terms of Fibonacci series and sum of all the n number 5
of terms of this series.
Example: suppose series contain 10 number of terms then the program should
print : Fibonacci series: 0 1 1 2 3 5 8 13 21 34 Sum of series: 88
OR
Write a menu driven program to implement a simple calculator in python. The program reads two
integer values and provides choice for the user to perform Addition, Subtraction, multiplication, and
division operations on those values. The program continuously gives choice for the user to perform
the above operations till the user select exit option.
SECTION – E 8
Case Study – 1
34. Barsha works at as a receptionist at a hotel. She has to note down numbers of numerous people every day.
She decided that she must make a program to keep a log of names with their contact number. Here is what
she worked on. Help her in completing her code by filling in the blanks: contacts={} a=1 while
a==1:
print(‘Enter 1 to add new contact’)
print(‘Enter 2 to view all contacts’) print()
Ask=int(input(‘Enter=’)) if
Ask==1:
(a)N=_____________ #Take input of Name
(b)C=_____________ #Take input of Number
(c)contacts([_______ #Make a key-value pair of Name and Number
Names=list(a.keys())
Numbers=list(a.values()) if
Ask==2:
for i in range (d)_____ #Repeat loop from 1 to max no. of elements
print(Names[i]) print(Numbers[i])
i. What should she write in (a) to take an input of Name from the user?
ii. What should she write in (b) to take the input of Contact Number from the user?
1
1
iii. What should she write in (c) to create a key-value pair in contacts? What should she write in (d) to 2
create a loop starting from 1 till the maximum number of elements in contacts?
Case Study – 2
35. You received an SMS shown below from your bank querying a recent transaction. Answer the following:
03036665458.
i. Would you SMS your pin number to the given contact number? Justify your answer. 1
ii. Will you call the bank helpline number to recheck the validity of SMS received? Justify your answer. 1
iii. Your Grandfather, who actively uses the internet and technology, is not aware of scams found online. You 2
are trying to discuss some points which can help identify if a certain offer is a scam or not. Choose any
four appropriate points below: