What will be the output of the following?
print(sum(1,2,3))
What will be the output of the following Python code
def func(a, b=5, c=10): print('a is', a, 'and b is', b, 'and c is', c) func(13, 17) func(a=2, c=4) func(5,7,9)
(A) a is 13 and b is 15 and c is 10
a is 2 and b is 5 and c is 4
a is 5 and b is 7 and c is 9
(B) a is 13 and b is 17 and cis 10
a is 2 and b is 4 and c is 4
a is 5 and b is 9 and c is 7
(C) a is 13 and b is 17 and c is 10
a is 2 and b is 5 and cis 4
(D) None of the above
What will be the output of the following Python code?
list1=[1,3] list2=list1 list1[0]=4 print(list2)
What will be output for the following code ?
import numpy as np a=np.array([2,3,4,5]) print(a.dtype)
What is the output of the following
y='klmn' for i in range(len(y)): print(y)
len(["hello",2, 4, 6])
from math import factorial print(math.factorial(5))
What will be the output of the following code snippet?
numbers = (4, 7, 19, 2, 89, 45, 72, 22) sorted_numbers = sorted(numbers) odd_numbers = [x for x in sorted_numbers if x% 2!=0] print(odd_numbers)
Integer a, b, c Set b= 5, a = 1 c= a & b Print c
Choose the correct function declaration of fun1() so that we can execute the following two function calls successfully.
fun1(25, 75, 55) fun1(10, 20)
x='abcd' for i in x: print(i.upper())
What will be the output of the following expression
x=14 print(x>>2)
What is the datatype of x ?
import numpy as np a=np.array([1,2,3,4]) x=a.tolist()
What is the output of the following code snippet?
print([i.lower() for i in "HELLO"])
What will be the output of following?
Y=[2,5J,6] Y.sort()
What is the output of the following code?
import numpy as np a=np.array([1,2,3,5,8]) b=np.array([0,3,4,2,1]) c=a+b c=c*a print(c[2])
Which of the following error is returned by the given code ?
f = open("test.txt","w") f.write(345)
What will be the output of the following algorithm for a=5, b-8, c=6 ?
Step 1: Start Step 2: Declare variables a, b and c. Step 3 Read variables a, b and c. Step 4: If a < b If a <c Display a is the smallest number. Else Display c is the smallest number. Else If b <c Display b is the smallest number. Else Display c is the smallest number Step 5:Stop
What is the output of following code ?
a = np.array([[1,2,3],[4,5,6]]) print(a.shape)
def s(n1): print(n1) n1=n1+2 n2=4 s(n2) print(n2)
What is the output of the following?
x=123 for i in x: print(i)
What will be the output of following statement ?
>>>"m"+"n1"
m=0 while m<5: m+=1 if m==3: break else: print(0)
What will be output for the following code?
import numpy as np a=np.array([[1,2,3],[0,1,4]]) print (a.size)
n=5 while n>0: n-=1 if n==2: continue print(n,end=' ')
tuple1=(5,1,7,6,2) tuple1.pop(2) print(tuple1)
What will be the output of the following Python code ?
def display(b,n): while n>0: print(b,end='') n=n-1 display('z',3)
import numpy as np
ary=np.array([1,2,3,5,8])
ary=ary+1
print(ary[1])
Which of the following will delete key-value pair for key="tiger" in dictionary?
dic={"lion":"'wild","tiger":"'wild",'cat":"domestic","dog":"domestic"}
d1={"abc":5,"def":6,"ghi":7} print(d1[0])
def power(x, y=2): r=1 for i in range(y): r=r*x return r print(power(3)) print(power(3,3))
what will be output for the following code?
import numpy as np a=np.array([1,2,3,5,8]) print(a.ndim)
what is 'f' in the following statement?
f=open("Data.txt","r")
What will following code segment print
if True or True: if False and True or False: print('A') elif False and False or True and True: print('B') else: print('C') else: print('D')