KnowledgeBoat Logo

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)
    

  • Python Control Flow

    Write the output of the following:

    for j in range(10, 6, -2): 
        print(j*2)
    

  • 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)
    

  • Python Control Flow

    Write the output of the following:

    for x in range(10, 20): 
        if (x == 15):
            break
    print(x)
    

  • Python Control Flow

    Write the output of the following:

    for x in range(10, 20): 
        if (x % 2 == 0): 
           continue
    print(x)
    

  • 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")
    

  • 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 = "*")
    

  • 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)
    

  • 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 Answer

    37 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 Answer

    30 Likes


Showing 21 - 30 of 98 Questions