CBSE Class 11 – Computer Science Question Paper 2023
SECTION – A
Each question carries 1 marks
1. Give one example for the following
a) Utility Software
**Example:** Antivirus software (like Norton, McAfee)
b) Language Processor
**Example:** Compiler (e.g., GCC for C/C++) or Interpreter (e.g., Python interpreter)
2. Name the Python modules which need to be imported to invoke the following functions
a) randrange()
**Module:** `random`
b) mean()
**Module:** `statistics`
3. Which of the following is NOT done by cyber criminals?
a) Unauthorized account access
b) Mass attack using Trojans as botnets
c) Email spooling and spamming
d) **Report vulnerability in any system**
4. Predict output of the following statement.
print('Amrit Mahotsav @75'.partition())
**Output:** ('Amrit Mahotsav ', '@', '75')
5. Let X be a number system having B symbols only. What will be the base value of this number system?
**Base value:** B
6. What will be the output for following Code?
a = [1, 2, (3, 4)]
a[2][1] = 5
print(a)
**Output:** b) [1, 2, (3, 5)]
7. Which of the following is/are NOT legal python string?
a) 'abc' + 'abc'
b) 'abe' * 3
c) **'abc' + 3**
d) 'abc'abc'
8. Answer in True or False
a) Like '+', all other arithmetic operators are also supported by strings.
**False**
b) A=[] and A=list() will produce the same result.
**True**
9. What will be the output for following Code?
P = 7 * 8 / 5 / 124 * 1 ** 3
print(p)
**Output:** 0.00903225806451613
10. What can be done to reduce the risk of identity theft? Write any two ways.
-
Two ways to reduce the risk of identity theft:
- Strong Passwords: Use complex passwords with a mix of uppercase and lowercase letters, numbers, and symbols. Avoid using easily guessable information like birthdays
1 or pet names. Consider using a password manager to generate and store strong passwords securely. - Regularly Monitor Credit Reports: Obtain credit reports from all three major credit bureaus (Equifax, Experian, and TransUnion) and review them for any suspicious activity. This will help you identify and rectify any fraudulent activity quickly.
- Strong Passwords: Use complex passwords with a mix of uppercase and lowercase letters, numbers, and symbols. Avoid using easily guessable information like birthdays
11. Use functions/objects from math module to write a Python expression for the mathematical expression e^-x²
- Python expression:
math.exp(-math.pow(x, 2))
12. When do we need to use a break statement in Python programs?
-
Purpose of break statement: The
break
statement is used to exit a loop prematurely, regardless of whether the loop’s condition is met. -
Scenarios for using break:
- Breaking out of nested loops: If you need to exit both the inner and outer loops based on a certain condition.
- Finding the first occurrence: If you are searching for a specific value or condition within a loop, and you only need to find the first instance.
- Breaking out of infinite loops: If you have a loop with a condition that might never become false, you can use
break
to exit the loop under specific circumstances.
13. Write two advantages of Python Programming Language
-
Two advantages of Python:
- Readability: Python’s syntax is clean, concise, and easy to read, making it beginner-friendly and improving code maintainability.
- Large Standard Library: Python comes with a vast collection of built-in functions and modules that provide ready-to-use solutions for various tasks, such as working with files, networking, and data manipulation.
14. Arrange the following in ascending order of memory capacity: TB, Byte, KB, Nibble, PB, MB, GB
- Ascending order: Nibble, Byte, KB, MB, GB, TB, PB
15. Suggest any two practices to ensure Communication Etiquette over the internet
-
Two practices for internet communication etiquette:
- Be respectful and considerate: Use appropriate language, avoid using all caps (which is considered shouting), and respect others’ opinions even if you disagree.
- Maintain privacy: Be mindful of what information you share online and with whom. Avoid sharing personal details like your address or phone number with strangers.
16. Things like online email account, social media account or handle, online shopping account, online photo sharing account, trademarks, own registered domain name etc are collectively called
- Correct answer: (c) Digital identity
17. ASSERTION AND REASONING based question
**Assertion (A):** Strings in Python are mutable.
**Reason (R):** The first character has the index 0 and the last character has the index n-1 where n is
the length of the string.
**Correct choice:** (e) Both A and R are False
* **Explanation:** Strings in Python are immutable, meaning they cannot be changed after they are created.
The reason is true, but it does not explain why strings are mutable.
18. ASSERTION AND REASONING based question
**Assertion (A):** clear() method removes all elements from the dictionary.
**Reason (R):** len() function cannot be used to find the length of a dictionary.
**Correct choice:** (c) A is True but R is False
* **Explanation:** The `clear()` method indeed removes all elements from a dictionary. However,
the `len()` function can be used to find the length (number of key-value pairs) of a dictionary.
SECTION – B
Each question carries 2 marks
19. Fill in the blanks
a) 10 KB is equivalent to **10,240** bytes. (1 KB = 1024 bytes)
b) Complete the DeMorgan's Law, A'+B'= **(A.B)'**
20. Predict the output of the Python code given below:
T=(1,2,3,4,5,6,7,8)
a) print(T[0]) **Output: 1**
b) print(T[3:4]) **Output: (4,)**
c) print(T[4:]) **Output: (5, 6, 7, 8)**
d) print(T[2:6:2]) **Output: (3, 5)**
21. Consider a given list of numbers, write a program to create another list which stores half of each even number and double of each odd number in the given list. Also, display the newly created list.
Python
def transform_list(numbers):
new_list = []
for num in numbers:
if num % 2 == 0: # Even number
new_list.append(num // 2)
else: # Odd number
new_list.append(num * 2)
return new_list
# Example usage
numbers = [3, 5, 6, 2, 7, 4, 5, 8]
new_list = transform_list(numbers)
print(new_list) # Output: [6, 10, 3, 1, 14, 2, 10, 4]
22. Explain mutable and immutable data types using Python statements? Also, Give one example data type of mutable and immutable data types.
-
Mutable Data Types: These are data types whose values can be changed after they are created.
- Example: Lists (
list
) - Demonstration:
Python
my_list = [1, 2, 3] my_list[0] = 10 # Modifying the list print(my_list) # Output: [10, 2, 3]
- Example: Lists (
-
Immutable Data Types: These are data types whose values cannot be changed once created. A new object needs to be created to change the value.
- Example: Strings (
str
) - Demonstration:
Python
my_string = "hello" my_string[0] = 'H' # This will raise an error
- Example: Strings (
23. Write a short note on the Act which enforces cyber laws in India
- Act: The Information Technology Act, 2000, is the primary legislation that governs cyber laws in India. It has been amended several times to keep up with the evolving digital landscape.
OR
Differentiate between General Public License (GPL) and Creative Commons (CC) for licensing digital properties.
-
GPL (General Public License):
- Copyleft License: Allows users to freely use, modify, and distribute the work, but any modifications must also be released under the GPL.
- Often used for software: Promotes open-source development and collaboration.
-
Creative Commons (CC):
- Flexible licenses: Offer a range of options for creators to share their work while maintaining some control over how it is used.
- Used for various media: Including text, images, music, and videos.
- Examples: CC BY (Attribution), CC BY-SA (Attribution-Share Alike)
24. Write a program for checking whether the given character is uppercase, lowercase, digit, or a special symbol.
Python
def check_character_type(char):
if char.isupper():
return "Uppercase"
elif char.islower():
return "Lowercase"
elif char.isdigit():
return "Digit"
else:
return "Special Symbol"
# Example usage
char = input("Enter a character: ")
char_type = check_character_type(char)
print(f"The character '{char}' is {char_type}")
25. State the common gender and disability issues faced while teaching/using computers in classrooms?
-
Gender Issues:
- Stereotypes: Gender stereotypes can discourage girls and women from pursuing careers in technology.
- Access and Opportunity: Unequal access to technology and computer education can limit opportunities for girls and women.
-
Disability Issues:
- Accessibility: Students with disabilities may face challenges in accessing and using computers, such as physical limitations, visual impairments, or cognitive disabilities.
- Assistive Technologies: Ensuring that appropriate assistive technologies are available and accessible to students with disabilities is crucial.
SECTION – C
Each question carries 3 marks
26. Write a program which takes a positive integer n as an input and prints n terms of Fibonacci series.
Python
def fibonacci_series(n):
"""
Generates and prints the first n terms of the Fibonacci series.
Args:
n: The number of terms to generate.
Returns:
None
"""
if n <= 0:
print("Invalid input. Please enter a positive integer.")
return
first = 0
second = 1
print(first, end=" ")
print(second, end=" ")
for _ in range(2, n):
next_term = first + second
print(next_term, end=" ")
first = second
second = next_term
print()
# Example usage
n = int(input("Enter the number of terms: "))
fibonacci_series(n)
27. Write a program to display and count the frequency of the characters of a given string using a dictionary.
Python
def character_frequency(string):
"""
Calculates and displays the frequency of each character in a string.
Args:
string: The input string.
Returns:
None
"""
char_freq = {}
for char in string:
char_freq[char] = char_freq.get(char, 0) + 1
for char, freq in char_freq.items():
print(f"Frequency of '{char}' is {freq}")
# Example usage
input_string = "banana"
character_frequency(input_string)
28. Observe the following program and answer the questions that follow:
Python
low = 25
point = 4
for i in range(1, 5):
k = random.randint(1, point)
Number = low + k
print(Number, end=" ")
point = point - 1
a) What is the minimum and maximum value of Number?
- Minimum Value: 26 (When
low
is 25 andk
is 1) - Maximum Value: 29 (When
low
is 25 andk
is 4)
b) Find out, which line of output(s) out of (i) to (iv) will not be expected from the program?
- Line (iv) 29 26 26 25 is not expected. This sequence implies that the same random value (26) was generated twice in a row, which is unlikely with
random.randint
.
29. Shantanu wanted to gift his brother a football or a wrist watch. So, he searched them online. But after that every time he goes online, his web browser shows him advertisements about sports items and wrist watches.
a) Why is this happening?
- This is likely due to targeted advertising. When Shantanu searched for footballs and wrist watches, his browsing activity was tracked. Websites and advertisers use this data to tailor advertisements to his interests.
b) How could have Shantanu avoided them?
- Shantanu could have used private browsing mode or incognito mode in his web browser. This mode prevents the browser from saving browsing history and cookies, which are used for targeted advertising.
c) How can Shantanu get rid of this now?
- Clearing browsing history and cookies: This will remove the data used to target Shantanu with sports-related ads.
- Using ad blockers: Ad blockers can prevent most advertisements from appearing on websites.
- Customizing ad settings: Many browsers and online services allow users to customize their advertising preferences and limit the use of personal data for targeted advertising.
30.Given the following tuples:
Python
t1 = (425, 617, 425, 123, 515, 425, 123)
t2 = (777, 222)
Find the output of the following statements:
a) print(t1.index(425))
b) print(t1.count(425))
c) print(t1 + t2)
d) print(sum(t1))
e) print(sorted(t1))
print(t1)
f) print(max(t2))
Answers:
a) Output: 0
- The
index()
method returns the index of the first occurrence of the specified value. Int1
, the first occurrence of425
is at index 0.
b) Output: 3
- The
count()
method returns the number of occurrences of the specified value.425
appears 3 times int1
.
c) Output: (425, 617, 425, 123, 515, 425, 123, 777, 222)
- The
+
operator concatenates two tuples, creating a new tuple that contains all the elements of both tuples.
d) Output: 2343
- The
sum()
function calculates the sum of all elements in a tuple. Here, it adds all the numbers int1
.
e) Output: (123, 123, 425, 425, 425, 515, 617) (425, 617, 425, 123, 515, 425, 123)
sorted(t1)
creates a new sorted tuple (ascending order) without modifying the originalt1
. The secondprint(t1)
shows thatt1
remains unchanged.
f) Output: 777
- The
max()
function returns the largest element in a tuple. Int2
, the maximum value is 777.
SECTION – D
Each question carries 4 marks
Question 31
a) Identify and briefly explain the cybercrime being discussed in the above scenario.
Answer:
The cybercrime described in the scenario is Phishing.
- Explanation: Phishing involves tricking individuals into revealing sensitive information (like usernames, passwords, credit card details) by posing as a trustworthy entity (e.g., a bank, government agency, social media platform). In this case, the email impersonates the Income Tax Department, luring the victim to a fake website to enter their details.
b) What type of damages can be caused by viruses to your computer?
Answer:
Viruses can cause a variety of damages to a computer, including:
- Data loss: Viruses can delete or corrupt files and data.
- System crashes: They can disrupt the normal functioning of the operating system, leading to crashes or freezes.
- Performance slowdown: Viruses can consume system resources, slowing down the computer’s performance.
- Security breaches: Some viruses can steal personal information or allow hackers to gain remote access to the computer.
- Hardware damage: In rare cases, viruses can damage hardware components.
c) As a citizen of India, what advice you should give to others for e-waste disposal?
Answer:
Here are some tips for responsible e-waste disposal:
- Recycle: Look for authorized e-waste recyclers in your area. These companies have the expertise and equipment to safely dismantle and recycle electronic devices.
- Don’t throw away: Avoid throwing e-waste in the trash. It contains hazardous materials that can contaminate the environment.
- Repair and reuse: Before discarding a device, consider repairing or refurbishing it.
- Donate: Donate old but functional devices to charities or schools.
- Data security: Before disposing of any device, erase or wipe all personal data to prevent identity theft.
Question 32
a) Sunil got an assignment to write a python program which receives an integer and prints the number after doubling it. He is not getting desired results, help Sunil to find and correct the errors in his code given below:
Python
Number=input("Enter Number")
Double The Number=Number*2
Print (Double TheNumber)
Answer:
The code has several errors:
- Variable assignment:
Double The Number=Number*2
is not a valid variable name. Python uses underscores or camelCase for multi-word variable names. - Data type: The
input()
function returns a string. You need to convert it to an integer usingint()
. - Case sensitivity:
Print
should beprint
(lowercase) in Python.
Here’s the corrected code:
Python
Number = int(input("Enter Number: "))
Double_The_Number = Number * 2
print(Double_The_Number)
b) Write a python program to print the following pattern:
5
4 5
3 4 5
2 3 4 5
1 2 3 4 5
Answer:
Python
for i in range(5, 0, -1):
for j in range(i, 6):
print(j, end=" ")
print()