KnowledgeBoat Logo

Class - 12 CBSE Computer Science Important Output Questions 2025

  • Python Functions

    What is the output of following code fragments ?

    def increment(n):
        n.append([49])
        return n[0], n[1], n[2], n[3]
    L = [23, 35, 47]
    m1, m2, m3, m4 = increment(L)
    print(L)
    print(m1, m2, m3, m4)
    print(L[3] == m4)
    

  • Python Functions

    What will be the output of the following Python code ?

    V = 25
    def Fun(Ch):
        V = 50
        print(V, end = Ch) 
        V *= 2
        print(V, end = Ch)
    print(V, end = "*")
    Fun("!")
    print(V) 
    
    1. 25*50!100!25
    2. 50*100!100!100
    3. 25*50!100!100
    4. Error
    View Answer

    10 Likes


  • Python Funda

    What are variables ? How are they important for a program ?

    View Answer

    59 Likes


  • Python Functions

    What will be the output of the following program?

    num = 1
    def myfunc():
        global num
        num = 10 
    print (num) 
    print (myfunc())
    print (num)
    

  • Python Functions

    What will be the output of the following program?

    def display():
        print ("Hello",) 
    display()
    print("bye!")
    

  • Python Functions

    Predict the output of the following code:

    a = 10
    y = 5
    def myfunc (a) :
        y = a
        a = 2
        print ("y=",y, "a=", a) 
        print ("a+y", a + y) 
        return a + y
    print ("y=",y, "a=", a) 
    print (myfunc (a))
    print ("y=", y, "a=", a)
    

  • Python Functions

    Predict the output of the following code.

    def code(n):
        if n == 0:
           print ( 'Finally' ) 
        else:
           print (n)
    code (3)
    code (15)
    

  • Python Functions

    Predict the output of the following code.

    def code (n) :
        if n==0:
           print('Finally') 
        else:
           print(n)
    code (2-2)
    code (15)
    

  • Python Functions

    Predict the output of the following code.

    def code(n):
        if n == 0:
           print(' Finally') 
        else:
           print (n)
    code (10)
    

  • Python Functions

    Predict the output of the following code.

    def code (n) :
        if n==0:
           print ( 'Finally' ) 
        else:
           print (n)
           print (n-3)
    code (10)
    

Showing 51 - 60 of 98 Questions