Logo

Python Questions Set 9:

Quiz Mode

Find the output of the following code:


l1=[1,2,3,4]

l2=l1

x=id(l1)

y=id(l2)

print(x==y)

Solution:

Find the output of the following code:


l1=[1,2,3]

l2=[1,2,3]

x=id(l1)

y=id(l2)

print(x==y)

Solution:

x=int(input())

y=input()

print(x*y)



What does the above code prints if the input lines are 5 and 9

Solution:

var1=20

var2="80"

var4=int(var2)/var1

var5=int(var2)//var1

var6=var4%var5

print(int(var6)+var1+int(var2))

Solution:


a=input()

b=input()

print(a+b)


If the enters two lines  8 and 23 then what is the output of the above code?

Solution:

What naming convention is typically used by Python programmers for variables?

1
2
3
4

Solution:

Which of the following is a correct way to create a lambda function which returns the cube of its argument?

1
2
3
4

Solution:

What is the output of the given code?


def func(tup,x):

    count=0

    for i in tuple:

        if x==i:

            count=count+1

    return count

            


tuple=(1,5,6,7,5,6,1,6,6)

en=6

z=func(tuple,en)

print(z)


Solution:

Which of the following statements is false about recursion? 

1
2
3
4

Solution:

  Which of the following best describes polymorphism?
 

1
2
3
4

Solution: