CBSE Class 11 Computer Science Question Paper Set 12 with Solutions

Official CBSE Exam Papers for Class 11 Computer Science

Review targeted exam resources with the CBSE Class 11 Computer Science Question Paper Set 12 with Solutions. Built according to official CBSE standards for the 2026-27 academic year, these downloadable Class 11 Computer Science question papers support effective revision and performance tracking.

Solved Previous Year Papers for Computer Science

Navigate directly to the solved Computer Science question papers using the digital viewer below. Each practice set includes detailed solutions, allowing students to instantly cross-check their work and identify areas requiring further revision.

This is a CBSE Class 11 Computer Science annual exam question paper with answers, set for 66 marks in 2 hours 45 minutes and made up of 39 questions in 4 sections. It is based on the current NCERT syllabus and covers python basics (tokens, identifiers, data types, operators, expressions), conditional statements and loops, lists, tuples, dictionaries and strings, number systems and Boolean algebra, the ALU, and societal impact topics such as cyber trolling, malware, spam, encryption, hacking, digital footprints, social media etiquette, copyright and patents. Attempt it in exam conditions without looking at the answers, then open the answers and teacher's notes below to check your work.

Question Paper

Time Allowed: 2 hours 45 minutes
Maximum Marks: 66

General Instructions

1. All the questions are compulsory.
2. The number written at the right margin indicates the marks for the question.
3. The programming language is Python.
4. Where you are asked to show the output of a program, also show the evaluation process as part of the answer.
5. Give appropriate syntax and examples wherever necessary.
6. Ensure that there is no overwriting in the program.

Section A: Multiple Choice Questions

1 mark each

Q1. The name assigned by the programmer to some parts of a program (such as variables and functions) is called [1 mark]
(a) Literal
(b) Token
(c) Identifier
(d) Comment

View Answer & Explanation

Answer: (c) Identifier. Names given by the programmer to variables, functions, classes and so on are identifiers.

Teacher's Note:
1. Identifiers are user-chosen names, while literals are fixed values such as 5 or 'a'.
2. A token is the general term for any smallest unit of a program, so it is too broad an answer.

Q2. Which one of the following is not an immutable data type? [1 mark]
(a) int
(b) tuple
(c) string
(d) dictionary

View Answer & Explanation

Answer: (d) dictionary. A dictionary can be changed after creation (items added, modified or deleted), whereas int, tuple and string cannot.

Teacher's Note:
1. Remember the immutable group: int, float, bool, string and tuple.
2. Lists, dictionaries and sets are the mutable types.

Q3. X = 'ABC'
Y = int(X) #statement 1
What will be the outcome of the statement 'statement 1'? [1 mark]
(a) Assigns the value of X to Y
(b) Assigns the id of X to Y
(c) Converts String datatype to integer
(d) Error

View Answer & Explanation

Answer: (d) Error. int() can convert a string only if it holds digits; 'ABC' raises ValueError: invalid literal for int().

Teacher's Note:
1. int('25') works, but int('ABC') does not because the text is not a number.
2. Always check what the string contains before judging a type conversion.

Q4. Predict the output of the following statements.

X = complex(2)
print(X)
[1 mark]
(a) 2
(b) 2 + 0
(c) (2+0j)
(d) 2 + j

View Answer & Explanation

Answer: (c) (2+0j). complex(2) creates a complex number with real part 2 and imaginary part 0, and Python prints it as (2+0j).

Teacher's Note:
1. When only one argument is given, the imaginary part defaults to 0.
2. Python writes the imaginary unit as j and prints complex values in brackets.

Q5.

x, y = 5, 3
Which of the following statements will give 2 as output? [1 mark]
(a) print(x/y)
(b) print(x//y)
(c) print(x%y)
(d) print(x**y)

View Answer & Explanation

Answer: (c) print(x%y). 5 % 3 is the remainder 2. For the others: 5/3 = 1.666..., 5//3 = 1, 5**3 = 125.

Teacher's Note:
1. Use / for true division, // for floor division and % for the remainder.
2. Python is case sensitive, so the variables must be written the same way everywhere.

Q6.

a = True
b = False
c = False
print(not a or not b and c)
print(not a or b or not b and a)
Predict the output from the following options. [1 mark]
(a) False
True
(b) False
False
(c) True
True
(d) True
False

View Answer & Explanation

Answer: (a) False, True.
1. Precedence is not, then and, then or. First line: (not a) or ((not b) and c) = False or (True and False) = False or False = False.
2. Second line: (not a) or b or ((not b) and a) = False or False or (True and True) = True.

Teacher's Note:
1. Evaluate not first, then and, and finally or.
2. Putting brackets around each and-part makes such expressions easy to check.

Q7. The following statement was typed in the IDLE shell:

>>> 1>2<3
What will be the output? [1 mark]
(a) True
(b) False
(c) True, False
(d) Error

View Answer & Explanation

Answer: (b) False. Python treats a chained comparison as (1 > 2) and (2 < 3) = False and True = False.

Teacher's Note:
1. Chained comparisons are joined with an implicit and between neighbouring pairs.
2. Here the first pair fails, so the whole result is False.

Q8.

>>> list1 = [2,4,6,8,10,12]
>>> list1[6]
On execution of the above statements, which one of the following will be the output? [1 mark]
(a) True
(b) SyntaxError
(c) IndexError
(d) NameError

View Answer & Explanation

Answer: (c) IndexError. The list has 6 elements with valid indexes 0 to 5, so index 6 is out of range.

Teacher's Note:
1. The last valid index is always len(list) - 1.
2. Slicing never raises this error, but a single out-of-range index does.

Q9.

>>> list1 = ['Red','Green','Blue','Cyan']
>>> list1[1:3]
On execution of the above statements, which one of the following will be the output? [1 mark]
(a) ['Green', 'Blue']
(b) ['Red', 'Green']
(c) ['Red', 'Green', 'Blue']
(d) ['Green', 'Blue', 'Cyan']

View Answer & Explanation

Answer: (a) ['Green', 'Blue']. A slice [1:3] takes indexes 1 and 2; the end index 3 is excluded.

Teacher's Note:
1. In a slice start:stop the stop index is never included.
2. Counting indexes from 0 avoids the usual off-by-one slip.

Q10. Which of the following terms is used for the internet slang for a person who intentionally starts arguments or upsets others by posting inflammatory remarks? [1 mark]
(a) Cyber bullying
(b) Cyber trolling
(c) Cyber stalking
(d) Phishing

View Answer & Explanation

Answer: (b) Cyber trolling. A troll posts provocative or offensive comments to upset people or start arguments.

Teacher's Note:
1. Trolling aims to provoke a reaction, while bullying targets and harasses a particular person.
2. Phishing is a different crime, in which fake messages steal personal data.

Q11. A standalone malware computer program that replicates itself in order to spread to other computers is called [1 mark]
(a) Worm
(b) Virus
(c) Trojan
(d) Spam

View Answer & Explanation

Answer: (a) Worm. A worm is standalone and copies itself across networks without needing a host file.

Teacher's Note:
1. The key difference is that a virus needs a host program, while a worm does not.
2. A Trojan hides inside software that looks useful but does not copy itself.

Q12. You have received an unwanted message in your email inbox, sent through a computer-generated program. Which one of the following is the appropriate term for such communication? [1 mark]
(a) Adware
(b) Digital footprints
(c) Spam
(d) Virus

View Answer & Explanation

Answer: (c) Spam. Unsolicited bulk messages sent automatically are called spam.

Teacher's Note:
1. Think of spam as junk mail sent in bulk to many people.
2. Adware shows advertisements on your device, and is not an email message.

Q13. Which one of the following is not true for encryption? [1 mark]
(a) A way of scrambling data so that only authorized parties can understand the information
(b) A method by which information is converted into secret code that hides the information's true meaning
(c) It translates data into another form, or code, so that only people with access to a secret key can understand the data
(d) A protection against theft of personal information over Cyber Space without consent

View Answer & Explanation

Answer: (d). Options (a), (b) and (c) all describe encryption: converting data into code that only key holders can read. Option (d) describes the broader idea of privacy or data protection, not what encryption itself is.

Teacher's Note:
1. Encryption is a technique, while privacy protection is a goal that encryption helps to achieve.
2. In an 'is not true' question, test each option against the definition.

Q14. Which one of the following is true for a Dictionary? [1 mark]
(a) The items are accessed via the keys.
(b) The items are accessed via index.
(c) The items are accessed via index as well as keys.
(d) Each value maps to an index.

View Answer & Explanation

Answer: (a) The items are accessed via the keys. A dictionary stores key:value pairs and a value is retrieved with its key, for example D['what'].

Teacher's Note:
1. Lists and tuples use positions, but dictionaries use keys.
2. Keys must be unique and immutable, while values can be of any type.

Q15. The existing dictionary can be modified by: [1 mark]
(a) Overwriting the value for a particular key.
(b) Overwriting the key for a particular value.
(c) Overwriting the key, value for a particular value, key.
(d) Dictionary cannot be edited.

View Answer & Explanation

Answer: (a) Overwriting the value for a particular key. For example D['what'] = 5 replaces the old value of the key 'what'.

Teacher's Note:
1. A dictionary is mutable, but its keys cannot be changed in place.
2. To rename a key, you must add a new key and delete the old one.

Q16. Which of the following is not a Python legal string operation? [1 mark]
(a) 'abc' + 'abc'
(b) 'abc' * 3
(c) 3 * 'abc'
(d) 'abc' + 3

View Answer & Explanation

Answer: (d) 'abc' + 3. Concatenation with + needs two strings, and adding a string and an int raises TypeError. The others are valid: 'abcabc', 'abcabcabc' and 'abcabcabc'.

Teacher's Note:
1. The + operator joins two strings and * repeats a string by an integer.
2. Use str(3) first if you really want to join a number to text.

Section B: Short Answer Questions

Questions 17 to 33 carry 1 or 2 marks as shown

Q17. Prove algebraically the identity AB + BC + Ā C = AB + Ā C. [2 marks]

View Answer & Explanation

Answer: 1. Write LHS = AB + BC + ĀC.
2. Multiply BC by (A + Ā), which equals 1: BC = BC(A + Ā) = ABC + ĀBC.
3. LHS = AB + ABC + ĀBC + ĀC.
4. Group terms: AB(1 + C) + ĀC(B + 1).
5. Since 1 + C = 1 and B + 1 = 1, LHS = AB + ĀC = RHS. Hence proved. (This is the consensus theorem.)

Teacher's Note:
1. Insert the missing variable using A + Ā = 1 to expand the redundant term BC.
2. Then apply the absorption law X + XY = X to remove the extra terms.

Q18. Explain the working of the ALU. [2 marks]

View Answer & Explanation

Answer: 1. The ALU (Arithmetic Logic Unit) is the part of the CPU that performs all arithmetic and logical operations.
2. The control unit fetches the data and instruction and sends the operands (from registers or memory) to the ALU along with the operation to perform.
3. The ALU does arithmetic operations (addition, subtraction, multiplication, division) and logical operations (comparisons such as greater than, equal to, and AND, OR, NOT).
4. The result is sent back to a register or memory, and flags are set to show conditions such as zero or negative.

Teacher's Note:
1. Remember that the ALU only calculates, and the control unit decides what happens next.
2. Mention both arithmetic and logical operations to earn full marks.

Q19. Convert (4AAD)16 to its equivalent binary number. [1 mark]

View Answer & Explanation

Answer: Replace each hex digit with its 4-bit binary code: 4 = 0100, A = 1010, A = 1010, D = 1101.
So (4AAD)16 = (0100 1010 1010 1101)2 = (100101010101101)2.

Teacher's Note:
1. Each hexadecimal digit corresponds to exactly four bits.
2. Remember A = 10, B = 11, C = 12, D = 13, E = 14 and F = 15.

Q20. Subtract 1111 from 10000 using the 2's complement method. [1 mark]

View Answer & Explanation

Answer: 1. Make both numbers 5 bits: 10000 and 01111.
2. 1's complement of 01111 is 10000; add 1 to get the 2's complement: 10001.
3. Add: 10000 + 10001 = 1 00001.
4. Discard the carry (the leftmost 1), so the result is 00001 = 1.
Check: 16 − 15 = 1.

Teacher's Note:
1. Always write both numbers with the same number of bits before taking the complement.
2. A carry out of the leftmost bit is dropped, and it shows that the answer is positive.

Q21. Define Token with an example. [2 marks]

View Answer & Explanation

Answer: 1. A token is the smallest individual unit of a program that has a meaning for the interpreter. It is also called a lexical unit.
2. Python tokens are of five types: keywords, identifiers, literals, operators and punctuators.
3. Example: in the statement age = 15 + 2, the tokens are age (identifier), = and + (operators), and 15, 2 (literals).

Teacher's Note:
1. Always give a complete example that names each kind of token it contains.
2. Do not confuse a token with an identifier, because an identifier is just one kind of token.

Q22. Write the differences between Copyright and Patent. [2 marks]

View Answer & Explanation

Answer: 1. Protects: copyright protects original creative works such as books, music, software code and art. A patent protects a new invention or process.
2. Registration: copyright arises automatically when the work is created, while a patent must be applied for and granted.
3. What is covered: copyright covers the expression of an idea, not the idea itself. A patent covers the idea or technical working of the invention.
4. Duration: copyright generally lasts for the creator's lifetime plus 60 years in India, while a patent lasts for 20 years from filing.

Teacher's Note:
1. Learn the contrast as 'creative expression' for copyright against 'inventions' for a patent.
2. Give at least two clear points of difference for 2 marks.

Q23. Predict the output of the following statements.

X = 10
X = X + 10
X = X - 5
print(X)
X, Y = X - 2, 22
print(X, Y)
[2 marks]

View Answer & Explanation

Answer: 1. X = 10; then X = 20; then X = 15, so the first print gives 15.
2. In X, Y = X - 2, 22, the right side is evaluated first with the old X: 15 − 2 = 13 and 22. So X = 13 and Y = 22.
3. The second print gives 13 22.
Output:

15
13 22

Teacher's Note:
1. In a multiple assignment, the whole right side is evaluated before any name is changed.
2. Trace the value of X line by line to avoid slips.

Q24. Write the corresponding Python expression of the following mathematical expression: \( \sqrt{x} + \dfrac{x+y}{z} \) [1 mark]

View Answer & Explanation

Answer: import math
math.sqrt(x) + (x + y) / z
(Equivalent: x ** 0.5 + (x + y) / z.)

Teacher's Note:
1. Brackets around x + y are essential, otherwise only y would be divided by z.
2. Import the math module if you use math.sqrt().

Q25. Write the corresponding Python expression of the following mathematical expression: \( \sqrt[4]{x} \) [1 mark]

View Answer & Explanation

Answer: x ** (1/4) (or x ** 0.25).

Teacher's Note:
1. A fourth root is the same as raising to the power 1/4.
2. Brackets are needed around 1/4, because ** has higher precedence than /.

Q26. Find the syntax errors in the following Python code:

num = int(input('Enter an integer: '))
if num<0
    num = -num
if num>=0 AND num<=9
    print('Single digit number')
elif : num>=10 OR num<=99
    print('Two digit number')
elif : num<=999
    print('Three digit number')
    else : print('Number contains more than 3 digits')
[2 marks]

View Answer & Explanation

Answer: 1. if num<0 has no colon at the end; it should be if num<0:.
2. AND must be written in lower case: and. The line also needs a colon at the end.
3. elif : num>=10 OR ... has the colon in the wrong place and uses OR; it should be elif num>=10 or num<=99: (logically it should be and).
4. elif : num<=999 must be elif num<=999:.
5. The else is wrongly indented, so it must align with the if and elif keywords.
Corrected code:

num = int(input('Enter an integer: '))
if num < 0:
    num = -num
if num >= 0 and num <= 9:
    print('Single digit number')
elif num >= 10 and num <= 99:
    print('Two digit number')
elif num <= 999:
    print('Three digit number')
else:
    print('Number contains more than 3 digits')

Teacher's Note:
1. The condition always comes before the colon, and the colon ends every if, elif and else header.
2. Python's logical operators are in lower case: and, or, not.

Q27. Define Hacking. Differentiate between ethical and non-ethical hackers. [2 marks]

View Answer & Explanation

Answer: 1. Hacking means gaining access to a computer system, network or data by finding and exploiting weaknesses in it.
2. Ethical hacker: works with the owner's permission to find security weaknesses so that they can be fixed. The work is legal and is done for protection.
3. Non-ethical hacker (cracker or black-hat hacker): breaks into systems without permission, to steal, damage or misuse data. The work is illegal and done for personal gain or harm.

Teacher's Note:
1. Permission and intention are the two points that separate ethical from non-ethical hackers.
2. Add a one-line definition of hacking, since it is asked separately.

Q28. Explain the need for social media etiquettes. [2 marks]

View Answer & Explanation

Answer: 1. They keep online communication respectful and polite, which avoids conflict, trolling and bullying.
2. They protect your privacy and that of others, by not sharing personal details or posting someone's photo without consent.
3. They build a positive digital reputation, because what is posted stays on the internet and can affect studies and jobs.
4. They stop the spread of fake news, hate speech and unverified content, and give credit to the owners of content (avoiding plagiarism).

Teacher's Note:
1. Link each point to safety, respect or reputation, and support it with an example.
2. Two or more well explained points are enough for full marks.

Q29. Illustrate with an example the difference between the break and continue statements. [2 marks]

View Answer & Explanation

Answer: 1. break terminates the loop completely and control moves to the first statement after the loop.
2. continue skips the rest of the current iteration only, and the loop goes on with the next iteration.
Example:

for i in range(1, 6):
    if i == 3:
        break
    print(i)      # prints 1, 2

for i in range(1, 6):
    if i == 3:
        continue
    print(i)      # prints 1, 2, 4, 5

Teacher's Note:
1. Break exits the loop, but continue only skips the current round.
2. Show the output of both examples so the difference is clear.

Q30. How many times will the for loop be evaluated in the following Python code? Also mention the final value of i.

for i in range(0, 10):
    pass
[2 marks]

View Answer & Explanation

Answer: 1. range(0, 10) produces 0, 1, 2, ..., 9, which is 10 values, so the loop body runs 10 times.
2. The loop variable keeps the last value it received, so the final value of i is 9.

Teacher's Note:
1. The stop value of range() is never included.
2. The variable i keeps its last value even after the loop ends.

Q31. You are planning to go for a vacation. You surfed the Internet to get answers for the following queries:
a) Weather conditions
b) Availability of air tickets and fares
c) Places to visit
d) Best hotel deals
Which of the above mentioned actions might have created a digital footprint? Give reason(s). [2 marks]

View Answer & Explanation

Answer: All four actions (a, b, c and d) may have created a digital footprint.
1. Each search or website visit is stored in the browser history, cookies and the search engine's records.
2. Websites also log your IP address, the pages you visited and the time. This is a passive (unintentional) digital footprint.
3. If you log in, book tickets or hotels, or share details such as your name and card number, an active (intentional) footprint is left as well.

Teacher's Note:
1. A digital footprint is the trail of data you leave while using the internet, whether you intend it or not.
2. Name both active and passive footprints to show full understanding.

Q32. Rewrite the following code fragment using a for loop:

i = 100
while (i > 0):
    print(i)
    i -= 3
[2 marks]

View Answer & Explanation

Answer:

for i in range(100, 0, -3):
    print(i)
The loop prints 100, 97, 94, ..., 4, 1. The stop value 0 is excluded, so the last value printed is 1, exactly as in the while loop.

Teacher's Note:
1. The three arguments of range() are start, stop and step, and a negative step counts downwards.
2. Check the first and last printed values against the original loop.

Q33. How will you create a single element tuple? What will be the outcome of the statement X = (3)? [2 marks]

View Answer & Explanation

Answer: 1. A single-element tuple is created by writing a comma after the element: T = (3,) (or T = 3,).
2. In X = (3) there is no comma, so the brackets are only for grouping. X is just the integer 3, and type(X) gives <class 'int'>, not a tuple.

Teacher's Note:
1. It is the comma that makes a tuple, and not the brackets.
2. Check with type() if you are not sure what an expression has produced.

Section C: Short Programs and Output Questions

3 marks each

Q34. Write a Python code to produce the following pattern using nested for loops.

A
B A
C B A
D C B A
[3 marks]

View Answer & Explanation

Answer:

for i in range(4):
    for j in range(i, -1, -1):
        print(chr(65 + j), end=' ')
    print()
1. The outer loop runs for 4 rows (i = 0 to 3).
2. The inner loop counts down from i to 0, and chr(65 + j) converts 0, 1, 2, 3 to A, B, C, D.
3. end=' ' keeps each row on one line and print() moves to the next line.
The output is exactly the required pattern.

Teacher's Note:
1. Row i holds i + 1 letters, written in reverse order starting from the row's own letter.
2. Use end=' ' inside the inner loop, and an empty print() after it.

Q35. Write a program to find the sum of the following series (input x and n both):
x + x²/2 + x³/3 + ...... + xⁿ/n [3 marks]

View Answer & Explanation

Answer:

x = float(input('Enter x: '))
n = int(input('Enter n: '))
s = 0
for i in range(1, n + 1):
    s = s + x ** i / i
print('Sum of the series =', s)
1. The loop variable i goes from 1 to n, and the i-th term is xi / i.
2. Each term is added to s, which starts from 0.
3. Example: x = 2, n = 4 gives 2 + 2 + 2.6667 + 4 = 10.6667.

Teacher's Note:
1. Start the sum at 0 and use range(1, n + 1) so that n is included.
2. Check the program once with small values such as x = 2 and n = 4.

Q36. What does each of the following expressions evaluate to? Suppose that L is the list ['These', ['are', 'a', 'few', 'words'], 'that', 'we', 'will', 'use'].
(i) L[1][0::2]
(ii) L[:1] + L[1]
(iii) L[2::2] [3 marks]

View Answer & Explanation

Answer: (i) L[1] is ['are', 'a', 'few', 'words']; taking every second element from index 0 gives ['are', 'few'].
(ii) L[:1] is ['These'] and L[1] is the inner list, so joining them gives ['These', 'are', 'a', 'few', 'words'].
(iii) Starting from index 2 with step 2 picks indexes 2 and 4, giving ['that', 'will'].

Teacher's Note:
1. Work out the inner expression first, then apply the slice to its result.
2. In a slice a:b:c, c is the step, and an empty b means up to the end.

Q37. Given two lists:
L1 = ['this', 'is', 'a', 'List']
L2 = ['this', ['is', 'another'], 'List']
Which of the following expressions will cause an error and why?
(i) L1 == L2
(ii) L1.upper()
(iii) L1[3].upper()
(iv) L2.upper()
(v) L2[1].upper()
(vi) L2[1][1].upper() [3 marks]

View Answer & Explanation

Answer: Errors are caused by (ii), (iv) and (v).
1. (ii) and (iv): L1 and L2 are lists, and a list has no upper() method (AttributeError); upper() works only on strings.
2. (v): L2[1] is the list ['is', 'another'], so again upper() cannot be applied (AttributeError).
3. (i) gives False, because the lists differ; comparing is allowed. (iii) gives 'LIST'. (vi) gives 'ANOTHER'; these are strings.

Teacher's Note:
1. Always find out the type of the object before calling a method on it.
2. upper() belongs to strings and not to lists, even if the list holds strings.

Section D: Dictionary and String Programs

4 marks each

Q38. Suppose that D is the dictionary
D = {'what': 22, 'are': 11, 'you': 14, 'doing': 5, 'next': 9, 'Saturday?': 4}.
Write down what the value of D is after each of the following Python statements. Evaluate each statement starting with the same original value of D mentioned above.
(a) D['what'] = D['are']
(b) D.update({'Sunday': 25, 'what': 5})
(c) del D['you']
(d) D['which'] = 19 [4 marks]

View Answer & Explanation

Answer: (a) The value of 'what' becomes 11: {'what': 11, 'are': 11, 'you': 14, 'doing': 5, 'next': 9, 'Saturday?': 4}
(b) 'what' is updated to 5 and the new key 'Sunday' is added at the end: {'what': 5, 'are': 11, 'you': 14, 'doing': 5, 'next': 9, 'Saturday?': 4, 'Sunday': 25}
(c) The key 'you' is removed: {'what': 22, 'are': 11, 'doing': 5, 'next': 9, 'Saturday?': 4}
(d) A new key 'which' is added: {'what': 22, 'are': 11, 'you': 14, 'doing': 5, 'next': 9, 'Saturday?': 4, 'which': 19}

Teacher's Note:
1. Assigning to an existing key changes its value, while a new key is added at the end.
2. Restart each part from the original dictionary, since the question says so.

Q39. Given a string, the task is to find the frequencies of all the characters in that string and return a dictionary with the key as the character and its value as its frequency in the given string. Complete the following code and predict the output.

test_str = 'ARMY PUBLIC SCHOOL SHILLONG'
all_freq = {}
for i in test_str:
    if i in (i)______:
        all_freq[i] = (ii)______
    else:
        all_freq[i] = (iii)______
# printing result
print('Count of all characters is :\n' + str(all_freq))
[4 marks]

View Answer & Explanation

Answer: Blanks: (i) all_freq   (ii) all_freq[i] + 1   (iii) 1
If the character is already a key, its count goes up by 1; otherwise it is stored for the first time with count 1.
Output:

Count of all characters is :
{'A': 1, 'R': 1, 'M': 1, 'Y': 1, ' ': 3, 'P': 1, 'U': 1, 'B': 1, 'L': 4, 'I': 2, 'C': 2, 'S': 2, 'H': 2, 'O': 3, 'N': 1, 'G': 1}
The dictionary keys appear in order of first occurrence. Note that the space is also counted as a character.

Teacher's Note:
1. The in operator checks the keys of a dictionary, so use it before reading a count.
2. Do not forget that spaces are characters too and are counted.

Past Exam Papers & Solutions for Class 11 Computer Science

Download CBSE Class 11 Computer Science Question Paper Set 12 with Solutions for Class 11 Computer Science

Explore downloadable past papers for Class 11 Computer Science. Utilizing the CBSE Class 11 Computer Science Question Paper Set 12 with Solutions ensures complete preparedness by offering clear insights into historical question styles and marking expectations.

Master Marking Schemes and Time Management

Regular simulation of exam environments using past question documents builds crucial pacing abilities and eliminates last-minute test anxiety during Class 11 Computer Science assessments.

Offline Revision & Comprehensive Study Material

Wrap up your exam preparation by reviewing detailed answer keys and tackling additional practice sets. All resources on our platform are free to access.

FAQs

Where can I download the official PDF for CBSE Class 11 Computer Science Question Paper Set 12 with Solutions?

The CBSE Class 11 Computer Science Question Paper Set 12 with Solutions is available for download on StudiesToday.com. It includes complete set with all sections so that Class 11 students can practice with the exact same paper that came in the CBSE exams.

Are the solutions for CBSE Class 11 Computer Science Question Paper Set 12 with Solutions based on the official CBSE marking scheme?

Yes, the solutions for CBSE Class 11 Computer Science Question Paper Set 12 with Solutions are prepared by subject matter experts as per official marking scheme. Class 11 students will understand the structure of answers and 'step-marks' methodology Computer Science.

How does solving CBSE Class 11 Computer Science Question Paper Set 12 with Solutions help in preparing for the 2026 exams?

Solving previous year papers like CBSE Class 11 Computer Science Question Paper Set 12 with Solutions is important to understand repeat themes and question difficulty levels of Computer Science. It helps Class 11 students to test their time management skills too.

Can I access CBSE Class 11 Computer Science Question Paper Set 12 with Solutions in different languages?

Yes, where applicable, CBSE Class 11 Computer Science Question Paper Set 12 with Solutions is available in both English and Hindi mediums. All students from Class 11 can access Computer Science study material in their preferred language.

Is there a charge to download the CBSE Class 11 Computer Science solved papers?

No, all previous year question papers on StudiesToday, including CBSE Class 11 Computer Science Question Paper Set 12 with Solutions, are provided free of charge in mobile-friendly PDF.