Free tutorials & notes in Hindi & English · Clean code examples 🧰 Free PDF & Image Tools →
🏆 Revision & Practice  ·  Lesson 29

Important Questions & Viva

Multiple choice questions

  1. Which part of the CPU performs comparisons?

    (a) Control Unit   (b) ALU   (c) Register   (d) Cache  

    Show answer

    (b) ALU – Arithmetic Logic Unit

  2. 1 KB is equal to

    (a) 1000 bytes   (b) 1024 bits   (c) 1024 bytes   (d) 8 bits  

    Show answer

    (c) 1024 bytes

  3. Which memory is volatile?

    (a) ROM   (b) SSD   (c) RAM   (d) Hard disk  

    Show answer

    (c) RAM

  4. (1011)₂ in decimal is

    (a) 9   (b) 10   (c) 11   (d) 13  

    Show answer

    (c) 11

  5. Which gate is called a universal gate?

    (a) AND   (b) OR   (c) XOR   (d) NAND  

    Show answer

    (d) NAND

  6. ASCII code of "A" is

    (a) 65   (b) 97   (c) 48   (d) 32  

    Show answer

    (a) 65

  7. Which of these is a valid identifier?

    (a) 2total   (b) total-marks   (c) _total   (d) for  

    Show answer

    (c) _total

  8. Output of print(17 // 5, 17 % 5)

    (a) 3 2   (b) 3.4 2   (c) 2 3   (d) 3 3  

    Show answer

    (a) 3 2

  9. input() always returns a value of type

    (a) int   (b) float   (c) str   (d) bool  

    Show answer

    (c) str

  10. Which data type is immutable?

    (a) list   (b) dict   (c) set   (d) tuple  

    Show answer

    (d) tuple

  11. Output of "PYTHON"[1:4]

    (a) PYT   (b) YTH   (c) YTHO   (d) PYTH  

    Show answer

    (b) YTH

  12. Which method adds an item at the end of a list?

    (a) add()   (b) insert()   (c) append()   (d) extend()  

    Show answer

    (c) append()

  13. range(2, 10, 3) gives

    (a) 2 5 8   (b) 2 5 8 11   (c) 3 6 9   (d) 2 4 6 8  

    Show answer

    (a) 2 5 8

  14. Which keyword exits a loop immediately?

    (a) continue   (b) pass   (c) break   (d) exit  

    Show answer

    (c) break

  15. Which licence is used for free software with copyleft?

    (a) GPL   (b) Proprietary   (c) Freeware   (d) Shareware  

    Show answer

    (a) GPL

  16. Fake SMS asking to "update KYC" is an example of

    (a) Hacking   (b) Phishing   (c) Worm   (d) Adware  

    Show answer

    (b) Phishing

Find the output

Write the output yourself first, then open the answer.

Q1

Python
x = 10
y = x * 2 + 3 ** 2 // 4
print(x, y)
Show answer
Output
10 22

Q2

Python
s = 'Examination'
print(s[2:7], s[-4:], s[::4], s.count('a'))
Show answer
Output
amina tion Eii 2

Q3

Python
L = [4, 8, 15, 16, 23]
L.insert(2, 10)
L.pop()
L.remove(8)
print(L, len(L))
Show answer
Output
[4, 10, 15, 16] 4

Q4

Python
for i in range(1, 10, 3):
    if i == 7:
        break
    print(i, end='#')
else:
    print('done')
print('end')
Show answer
Output
1#4#end

Q5

Python
d = {'a': 1, 'b': 2}
d['c'] = d['a'] + d['b']
d['a'] = 10
print(d, sum(d.values()))
Show answer
Output
{'a': 10, 'b': 2, 'c': 3} 15

Q6

Python
def f(n, m=2):
    return n ** m

print(f(3), f(2, 3), f(m=1, n=9))
Show answer
Output
9 8 9

Q7

Python
t = (1, 2, 3)
a, b, c = t
t2 = t + (a * 4,)
print(t2, t2.index(4))
Show answer
Output
(1, 2, 3, 4) 3

Q8

Python
n = 0
while n < 10:
    n += 3
    if n == 6:
        continue
    print(n, end=' ')
print()
Show answer
Output
3 9 12

Short answer questions

  1. Differentiate between compiler and interpreter.

    Show answer

    A compiler translates the whole program into machine code at once and reports all errors together; the program runs faster later (C, C++). An interpreter translates and executes line by line, stopping at the first error (Python).

  2. What are the functions of an operating system?

    Show answer

    Process management, memory management, file management, device management, security (login, permissions) and providing a user interface.

  3. Convert (235)₁₀ into binary, octal and hexadecimal.

    Show answer

    Binary 11101011, octal 353, hexadecimal EB.

  4. Prove De Morgan’s first law using a truth table.

    Show answer

    Make columns A, B, A·B, (A·B)', A', B', A'+B'. For all four rows (00, 01, 10, 11) the columns (A·B)' = 1,1,1,0 and A'+B' = 1,1,1,0 are identical, so (A·B)' = A' + B'.

  5. What is the difference between mutable and immutable types? Give examples.

    Show answer

    Mutable objects can be changed in place (list, dict, set). Immutable objects cannot be changed; any change creates a new object (int, float, str, tuple).

  6. Differentiate between append() and extend().

    Show answer

    append(x) adds x as a single element at the end (even if x is a list). extend(seq) adds each element of seq separately.

  7. What is the difference between local and global variables?

    Show answer

    A local variable is defined inside a function and exists only there. A global variable is defined outside all functions and is accessible throughout the program; to modify it inside a function use the global keyword.

  8. What is a digital footprint? How can it be managed?

    Show answer

    It is the trail of data left online — active (posts, comments) and passive (cookies, location). Manage it by thinking before posting, using privacy settings, limiting app permissions and deleting unused accounts.

Viva questions

QuestionAnswer
Who developed Python?Guido van Rossum (1991).
What is the extension of a Python file?.py
What does IDLE stand for?Integrated Development and Learning Environment.
What is the difference between = and ==?= assigns a value; == compares two values.
What does len() do?Returns the number of items in a sequence or collection.
What is a docstring?A string in triple quotes written as the first line of a function to describe it.
Can a dictionary key be a list?No, keys must be immutable.
What is an infinite loop?A loop whose condition never becomes False.
What is indentation in Python?Spaces at the start of lines that define a block of code.
What is the use of pass?A do-nothing placeholder for an empty block.
What does the % operator give?The remainder of a division.
Name two mutable and two immutable data types.Mutable: list, dict. Immutable: tuple, str.

Exam tips

  1. 1For output questions, make a small trace table of variables and update it line by line.
  2. 2In conversions, show every division/multiplication step — steps carry marks.
  3. 3Draw neat truth tables with 2ⁿ rows in binary order 00, 01, 10, 11.
  4. 4Write programs with meaningful variable names and comments; indentation must be consistent.
  5. 5For theory, give a definition + one example from daily life.
Score better in Computer Science

Frequently Asked Questions

How should I prepare for the Class 11 CS exam?
Revise theory chapter by chapter, practise number conversions and Boolean tables on paper, and solve output questions by tracing code line by line. Run every program yourself.
What is asked in the Class 11 CS practical viva?
Basic Python concepts: data types, mutability, loops, functions, list and dictionary methods, error types, plus questions about the programs in your practical file.
← Class 11 Computer Science
🔗

Share this topic with a friend

यह topic किसी दोस्त को भेजें

Found it useful? Send it to a classmate learning the same thing.

अच्छा लगा? जो दोस्त यही सीख रहा है, उसे भेज दीजिए।

Course complete! Continue withClass 12 Computer Science Your progress: 29 / 29 (100%) · Recommended next course Continue →

How was this lesson?

Your feedback helps us make the content better.

Write a review or suggestion (optional)

After approval, your name and city may appear publicly with your review. Please do not write your email or phone number.

▶ CodingEasily on YouTube

Learn with video lessons in easy Hindi

Featured video: RDBMS Part 3 – Class XI Commerce IT

▶ Subscribe – it’s free