Class - 12 CBSE Computer Science Important Output Questions 2025
Python Control Flow
Write the output of the following:
for i in [100, 200, 300]: print(i)
View Answer3 Likes
Python Control Flow
Write the output of the following:
for j in range(10, 6, -2): print(j*2)
View Answer4 Likes
Python Control Flow
Write the output of the following:
for x in range(1, 6): for y in range(1, x+1): print (x, ' ', y)
View Answer5 Likes
Python Control Flow
Write the output of the following:
for x in range(10, 20): if (x == 15): break print(x)
View Answer3 Likes
Python Control Flow
Write the output of the following:
for x in range(10, 20): if (x % 2 == 0): continue print(x)
View Answer5 Likes
Python Control Flow
Write the output of the following program on execution if x = 50:
if x > 10: if x > 25: print("ok") if x > 60: print("good") elif x > 40: print("average") else: print("no output")
View Answer1 Likes
Python List Manipulation
Predict the output of the following code:
S = "LOST" L = [10, 21, 33, 4] D = {} for I in range(len(S)): if I % 2 == 0: D[L.pop()] = S[I] else: D[L.pop()] = I + 3 for K, V in D.items(): print(K, V, sep = "*")
View Answer7 Likes
Python String Manipulation
Predict the output of the Python code given below:
Text1 = "IND-23" Text2 = "" I = 0 while I < len(Text1): if Text1[I] >= "0" and Text1[I] <= "9": Val = int(Text1[I]) Val = Val + 1 Text2 = Text2 + str(Val) elif Text1[I] >= "A" and Text1[I] <= "Z": Text2 = Text2 + (Text1[I + 1]) else: Text2 = Text2 + "*" I += 1 print(Text2)
View Answer3 Likes
Python String Manipulation
What will be the output produced by following code fragments?
y = str(123) x = "hello" * 3 print (x, y) x = "hello" + "world" y = len(x) print (y, x)
View Answer37 Likes
Python String Manipulation
What will be the output produced by following code fragments?
x = "hello" + \ "to Python" + \ "world" for char in x : y = char print (y, ' : ', end = ' ')
View Answer30 Likes
Showing 21 - 30 of 98 Questions