ज़रूरी Questions और Viva
Multiple choice questions
Which part of the CPU performs comparisons?
(a) Control Unit (b) ALU (c) Register (d) Cache
Answer देखें
(b) ALU – Arithmetic Logic Unit
1 KB is equal to
(a) 1000 bytes (b) 1024 bits (c) 1024 bytes (d) 8 bits
Answer देखें
(c) 1024 bytes
Which memory is volatile?
(a) ROM (b) SSD (c) RAM (d) Hard disk
Answer देखें
(c) RAM
(1011)₂ in decimal is
(a) 9 (b) 10 (c) 11 (d) 13
Answer देखें
(c) 11
Which gate is called a universal gate?
(a) AND (b) OR (c) XOR (d) NAND
Answer देखें
(d) NAND
ASCII code of "A" is
(a) 65 (b) 97 (c) 48 (d) 32
Answer देखें
(a) 65
Which of these is a valid identifier?
(a) 2total (b) total-marks (c) _total (d) for
Answer देखें
(c) _total
Output of print(17 // 5, 17 % 5)
(a) 3 2 (b) 3.4 2 (c) 2 3 (d) 3 3
Answer देखें
(a) 3 2
input() always returns a value of type
(a) int (b) float (c) str (d) bool
Answer देखें
(c) str
Which data type is immutable?
(a) list (b) dict (c) set (d) tuple
Answer देखें
(d) tuple
Output of "PYTHON"[1:4]
(a) PYT (b) YTH (c) YTHO (d) PYTH
Answer देखें
(b) YTH
Which method adds an item at the end of a list?
(a) add() (b) insert() (c) append() (d) extend()
Answer देखें
(c) append()
range(2, 10, 3) gives
(a) 2 5 8 (b) 2 5 8 11 (c) 3 6 9 (d) 2 4 6 8
Answer देखें
(a) 2 5 8
Which keyword exits a loop immediately?
(a) continue (b) pass (c) break (d) exit
Answer देखें
(c) break
Which licence is used for free software with copyleft?
(a) GPL (b) Proprietary (c) Freeware (d) Shareware
Answer देखें
(a) GPL
Fake SMS asking to "update KYC" is an example of
(a) Hacking (b) Phishing (c) Worm (d) Adware
Answer देखें
(b) Phishing
Output बताइए
पहले ख़ुद output लिखें, फिर answer खोलें।
Q1
x = 10 y = x * 2 + 3 ** 2 // 4 print(x, y)
Answer देखें
10 22
Q2
s = 'Examination'
print(s[2:7], s[-4:], s[::4], s.count('a'))Answer देखें
amina tion Eii 2
Q3
L = [4, 8, 15, 16, 23] L.insert(2, 10) L.pop() L.remove(8) print(L, len(L))
Answer देखें
[4, 10, 15, 16] 4
Q4
for i in range(1, 10, 3):
if i == 7:
break
print(i, end='#')
else:
print('done')
print('end')Answer देखें
1#4#end
Q5
d = {'a': 1, 'b': 2}
d['c'] = d['a'] + d['b']
d['a'] = 10
print(d, sum(d.values()))Answer देखें
{'a': 10, 'b': 2, 'c': 3} 15Q6
def f(n, m=2):
return n ** m
print(f(3), f(2, 3), f(m=1, n=9))Answer देखें
9 8 9
Q7
t = (1, 2, 3) a, b, c = t t2 = t + (a * 4,) print(t2, t2.index(4))
Answer देखें
(1, 2, 3, 4) 3
Q8
n = 0
while n < 10:
n += 3
if n == 6:
continue
print(n, end=' ')
print()Answer देखें
3 9 12
Short answer questions
Differentiate between compiler and interpreter.
Answer देखें
Compiler पूरा program एक साथ machine code में बदलता है और सारी errors एक साथ बताता है; program बाद में तेज़ चलता है (C, C++)। Interpreter line by line translate और execute करता है, पहली error पर रुकता है (Python)।
Operating system के functions क्या हैं?
Answer देखें
Process management, memory management, file management, device management, security (login, permissions) और user interface देना।
(235)₁₀ को binary, octal और hexadecimal में बदलें।
Answer देखें
Binary 11101011, octal 353, hexadecimal EB।
Truth table से De Morgan का पहला law prove करें।
Answer देखें
Columns A, B, A·B, (A·B)', A', B', A'+B' बनाएँ। चारों rows (00, 01, 10, 11) में (A·B)' = 1,1,1,0 और A'+B' = 1,1,1,0 same हैं, इसलिए (A·B)' = A' + B'।
Mutable और immutable types में क्या फ़र्क है? Examples दें।
Answer देखें
Mutable objects उसी जगह बदल सकते हैं (list, dict, set)। Immutable objects नहीं बदलते; बदलाव से नया object बनता है (int, float, str, tuple)।
append() और extend() में अंतर बताइए।
Answer देखें
append(x) x को एक ही element के रूप में अंत में जोड़ता है (x list हो तब भी)। extend(seq) seq का हर element अलग से जोड़ता है।
Local और global variables में क्या फ़र्क है?
Answer देखें
Local variable function के अंदर define होता है और वहीं रहता है। Global variable सभी functions के बाहर define होता है और पूरे program में मिलता है; function के अंदर बदलने के लिए global keyword चाहिए।
Digital footprint क्या है? इसे कैसे संभालें?
Answer देखें
यह online छोड़ा गया data का निशान है — active (posts, comments) और passive (cookies, location)। Post से पहले सोचकर, privacy settings, सीमित app permissions और बेकार accounts delete करके इसे संभालें।
Viva questions
| प्रश्न | उत्तर |
|---|---|
| Python किसने बनाई? | Guido van Rossum (1991). |
| Python file का extension क्या है? | .py |
| IDLE का full form? | Integrated Development and Learning Environment. |
| = और == में फ़र्क? | = assigns a value; == compares two values. |
| len() क्या करता है? | Returns the number of items in a sequence or collection. |
| Docstring क्या है? | A string in triple quotes written as the first line of a function to describe it. |
| क्या list dictionary key बन सकती है? | No, keys must be immutable. |
| Infinite loop क्या है? | A loop whose condition never becomes False. |
| Python में indentation क्या है? | Spaces at the start of lines that define a block of code. |
| pass का use? | A do-nothing placeholder for an empty block. |
| % operator क्या देता है? | The remainder of a division. |
| दो mutable और दो immutable types बताइए। | Mutable: list, dict. Immutable: tuple, str. |
Exam tips
- 1Output questions में variables की छोटी trace table बनाकर line by line update करें।
- 2Conversions में हर division/multiplication step दिखाएँ — steps के marks मिलते हैं।
- 32ⁿ rows वाली साफ़ truth tables binary क्रम 00, 01, 10, 11 में बनाएँ।
- 4Meaningful variable names और comments के साथ programs लिखें; indentation consistent हो।
- 5Theory में definition + रोज़ की ज़िंदगी का एक example दें।
