0% found this document useful (0 votes)
20 views

Class 11 - CS - Practice questions

The document contains practice questions for Class 11 Computer Science, covering topics such as Python programming, cyber crimes, data structures, and dictionary operations. It includes multiple-choice questions, short answer type questions, and long answer type questions, focusing on practical coding skills and theoretical understanding. The questions test knowledge on Python syntax, list and dictionary methods, and concepts related to computer ethics.

Uploaded by

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

Class 11 - CS - Practice questions

The document contains practice questions for Class 11 Computer Science, covering topics such as Python programming, cyber crimes, data structures, and dictionary operations. It includes multiple-choice questions, short answer type questions, and long answer type questions, focusing on practical coding skills and theoretical understanding. The questions test knowledge on Python syntax, list and dictionary methods, and concepts related to computer ethics.

Uploaded by

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

Class 11 – Computer Science (083)

Practice questions:-

Q.1. Find the output of the following program code :-


list1 = [12,32,65,26,80,10]
list1.sort()
print(list1)

Q.2. What will be the output of the following Python code?


tp1=(2,4,3)
tp3=tp1*2
print(tp3)

Q.3. After practicals, Atharv 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 Atharv. He sends inflammatory email
messages to few of his classmates using Atharv’s email account. Revaan’s
activity is an example of which of the following cyber crime?
a) Hacking b) Identity theft c) Cyber bullying d) Plagiarism

Q.4. Consider the list aList=["SIPO",[1,3,5,7]]. What would the following


code print? print(aList[0][1],aList[1][1])

Q.5. Suhana is down with fever. So, she decided not to go to school tomorrow.
Next day, in the evening she called up her classmate, Shaurya and enquired
about the computer class. She also requested him to explain the concept.
Shaurya said, “Mam taught us how to use tuples in python”. Further, he
generously said, “Give me some time, I will email you the material which will
help you to understand tuples in python”. Shaurya quickly downloaded a 2-
minute clip from the Internet explaining the concept of tuples in python. Using
video editor, he added the text “Prepared by Shaurya” in the downloaded video
clip. Then, he emailed the modified video clip to Suhana. This act of Shaurya is
an example of:
a) Fair use b) Hacking c) Copyright infringement d) Cyber crime

Q.6. What is the length of the tuple shown below?


t=(((('a',1),'b','c'),'d',2),'e',3)

Q.7. What gets printed on executing the following code?


names=['Hasan','Balwant','Sean','Dia']
print(names[-1][-1])

Q.8. Given the dictionary

1|Page
product_list={'Potato Chips':175, 'Pasta':140,'Besan':150,'Cheesy
bits':200,'Corn puff':250},
write a Python statement to add another product to it :- Chilly Sticks, 300

Q.9. What is the difference between (30) and (30,)?

Q.10. What would the following code print?


d={'spring':'autumn','autumn':'fall','fall':'spring'}
print(d['autumn'])

Q.11. After a fight with your friend, you did the following activities. Which of
these activities is not an example of cyber bullying?
a) You sent an email to your friend with a message saying that “I am sorry”.
b) You sent a threatening message to your friend saying “Do not try to call or
talk to me”.
c) You created an embarrassing picture of your friend and uploaded on your
account on a social networking site.

Q.12. What will the following code do?


dict={"Phy":94,"Che":70,"Bio":82,"Eng":95}
dict.update({"Che":72,"Bio":80})

Q.13. What will be the output of the following statement:


print(16*5/4*2/5-8)

Q.14. Identify the invalid Python statement from the following:


(a) d=dict( ) (b) e={ } (c) f=[ ] (d) g=dict{ }

Q.15. Consider the statements given below and then choose the correct output
from the given options:-

myStr="MISSISSIPPI"
print(myStr[:4]+"#"+myStr[-5:])

(a) MISSI#SIPPI (b) MISS#SIPPI


(c) MISS#IPPIS (d) MISSI#IPPIS

Q.16. Identify the statement from the following which will raise an error:

(a) print("A"*3) (b) print(5*3)


(c) print("15"+3) (d) print("15"+"13")

Q.17. Select the correct output of the following code:


event="G20 Presidency@2023"
L=event.split(' ')
print(L[::-2])
(a) 'G20'

2|Page
(b) ['Presidency@2023']
(c) ['G20']
(d) 'Presidency@2023'

Short Answer Type Questions – I :-


Each question carries 2 marks.

Q.18. Explain the list functions with suitable programming examples :-


(i) extend() (ii) remove()
Q.19. You got the below shown SMS from your bank querying a recent
transaction.

What action will you take to combat this situation?

Q.20. If a is (1,2,3) (a) What is the difference (if any) between a*3 and
(a,a,a)?
(b) What is the difference between a[1:2] and a[1:1]?

Q.21. Consider the following dictionary stateCapital:


stateCapital = {"AndhraPradesh":"Hyderabad",
"Bihar":"Patna","Maharashtra":"Mumbai", "Rajasthan":"Jaipur"}
Find the output of the following statements:
i.print(stateCapital.values()) ii. print(stateCapital.items())

Q.22. Give the output of the following :-


values=[[3,4,5,1],[33,6,1,2]]
for row in values:
row.sort()
for element in row:
print(element,end=" ")
print()

3|Page
Q.23. Find the error. Following code intends to create a tuple with three identical
strings. But even after successfully executing following code (No error reported
by Python), the len() returns a value different from 3. Why?
tup1=('Mega')*3
print(len(tup1))

Q.24. Explain any two ways of creating dictionary with suitable programming
examples.

Q.25. The code given below accepts five numbers and displays whether they
are even or odd:
Observe the following code carefully and rewrite it after removing all syntax and
logical errors: and rewrite it after removing all
Underline all the corrections made.

for i in range(5)
num=int(input("Enter a number")
if num/2==0:
print("Even")
else:
print("Odd")

Q.26. Write a program in Python which :-

(i) reads a dictionary S from user which contains Name:[Eng, Math, Science] as
key: value pairs and print the dictionary.
(ii) And then it displays the corresponding grade obtained by the students
according to the following grading rules:

For example: Consider the following dictionary


S={"AMIT": [92,86,64], "NAGMA": [65,42,43], "DAVID": [92,90,88]}
The output should be :
AMIT - B
NAGMA - C
DAVID – A

Q.27.

4|Page
Section - C

Short Answer Type Questions – II :-


Each question carries 3 marks.

Q.28. Given a list ‘alist’, write the most appropriate list method to perform the
following tasks on it:
(a) Delete a given element from the list.
(b) Add an element in the end of the list.
(c) Add an element in the beginning of the list.

Q.29. Given a tuple namely cars storing car names as elements :


('Toyota','Honda','GM','Ford','BMW','Volkswagon','Mercedes','Ferrai
','Porshe')
Write a program to print names of the cars in the index range 2 to 6, both
inclusive.
The output should also include the index in words as shown below:
One Honda
Two GM
:

Q.30. Why is the following code producing error? Correct the error and display
the output of the corrected code.
box,jars,crates={},{},{}
box['biscuit']=1
box['cake']=3
jars['jam']=4
crates['box']=box
crates['jars']=jars
print(len(crates[box]))

Section - D

Long Answer Type Questions :-


Each question carries 4 mark.

5|Page
Q.31. Write a program to create a dictionary with the roll number, name and
marks of n students in a class and display the names of students who have
marks above 75.
Ex-
stu_marks={1:["Aditya Rao",80],
2:["Bela Singh",45],
3:["Manoj Verma",76],
4:["Devesh Patel",84]}

Names displayed should be

Aditya Rao
Manoj Verma
Devesh Patel

Q.32. A tuple contains the marks of 5 students in three subjects (eng,cs,math) :-

Subject_marks=(

(80,78,75),

(15.5,30.0,20.0),

(65,73.4,60),

(12.0,23.3,13.3),

(30.0,40.0,25.5),

i. Write a program to find the average (percentage) of all 5 students.


ii. Find the maximum and minimum marks in math.

------------end-------------

6|Page

You might also like