Careerschool - Python Pre-screening Interview
Python Assessment 
Email *
Full Name *
Phone Number *
Name of the College *
Department Name *
Do you have any Arrears? *
 Is Python case sensitive when dealing with identifiers? *
1 point
Which of the following is the correct extension of the Python file?
*
1 point
All keywords in Python are in _________
*
1 point
What will be the value of the following Python expression?

4 + 3 % 5
*
1 point
Which of the following is used to define a block of code in Python language?
*
1 point
What is the maximum length of a Python identifier?
*
1 point
What will be the output of the following code snippet?

print(2**3 + (5 + 6)**(1 + 1))
*
1 point
What will be the datatype of the var in the below code snippet?

var = 10 print(type(var)) var = "Hello" print(type(var))
*
1 point
list, tuple, and range are the ___ of Data Types.
*
1 point
bytes, bytearray, memoryview are type of the ___ data type.
*
1 point
What is the name of the operator ** in Python?
*
1 point
The % operator returns the ___.
*
1 point
Amongst which of the following is / are the conditional statement in Python code?
*
1 point
What will be the output of the following Python code?

a=7 
if a>4: print("Greater")
*
1 point
What will be the output of the following Python code?

x,y = 12,14
if(x+y==26): print("true"
else: print("false")
*
1 point
Consider the following code segment and identify what will be the output of given Python code?

a = int(input("Enter an integer: ")) 
b = int(input("Enter an integer: ")) 
if a <= 0
     b = b +1 
else
     a = a + 1

*
1 point
What will be the output of the following Python code?

num = 10 
  if num > 0
        print("Positive number") 
elif num == 0
       print("Zero") 
else
       print("Negative number")
*
1 point
Loops are known as ___ in programming.
*
1 point
The continue keyword is used to ___ the current iteration in a loop.
*
1 point
What will be the output of the following Python code?

for i in range(6): 
        print(i)
*
1 point
What is the output of the following program

L1 = []
L1.append([1, [2, 3], 4])
L1.extend([7, 8, 9])
print(L1[0][1][1] + L1[2])
*
1 point
What is the output of the following program? 

L1 = [1, 1.33, 'GFG', 0, 'NO', None, 'G', True]
val1, val2 = 0, ''
for x in L1:
    if(type(x) == int or type(x) == float):
        val1 += x
    else if(type(x) == str):
        val2 += x
    else:
        break
print(val1, val2)
*
1 point
What is the output of the following program? 

L1 = [1, 2, 3, 4]
L2 = L1
L3 = L1.copy()
L4 = L3
L1[0] = [5]
print(L1, L2, L3, L4)

*
1 point
What is the output of the following program? 

import sys
L1 = tuple()
print(sys.getsizeof(L1), end = " ")
L1 = (1, 2)
print(sys.getsizeof(L1), end = " ")
L1 = (1, 3, (4, 5))
print(sys.getsizeof(L1), end = " ")
L1 = (1, 2, 3, 4, 5, [3, 4], 'p', '8', 9.777, (1, 3))
print(sys.getsizeof(L1))
*
1 point
What is the output of the following program?  

T1 = (1)

T2 = (3, 4)

T1 += 5

print(T1)

print(T1 + T2)
*
1 point
What is the output of the following program

mylist = ['geeks', 'forgeeks']
for i in mylist:
    i.upper()
print(mylist)
*
1 point
What is the output of the below program

i = 1
while True:
    if i % 0O7 == 0:
        break
    print(i)
    i += 1
*
1 point
Output of the following program

True = False
while True:
    print(True)
    break
*
1 point
Output of the following program

i = 1
while True:
    if i % 3 == 0:
        break
    print(i)
    i + = 1
*
1 point
Output of the following program

data = 50
try:
    data = data/0
except ZeroDivisionError:
    print('Cannot divide by 0 ', end = '')
else:
    print('Division successful ', end = '')
  
try:
    data = data/5
except:
    print('Inside except block ', end = '')
else:
    print('GFG', end = '')
*
1 point
Output of the following program

data = 50
try:
    data = data/10
except ZeroDivisionError:
    print('Cannot divide by 0 ', end = '')
finally:
    print('GeeksforGeeks ', end = '')
else:
    print('Division successful ', end = '')
*
1 point
Which of the following functions can help us to find the version of python that we are currently working on?
*
1 point
What is the order of precedence in python?
*
1 point
What does pip stand for python?
*
1 point
What are the values of the following Python expressions?

2**(3**2) (2**3)**2 2**3**2
*
1 point
Output of the following program

min(max(False,-3,-4), 2,7)
*
1 point
Which one of the following is not a keyword in Python language?
*
1 point
Which module in the python standard library parses options received from the command line?
*
1 point
What arithmetic operators cannot be used with strings in Python?
*
1 point
What is the output of the following Python Code

print("abc. DEF".capitalize())
*
1 point
What will be the value of ‘result’ in following Python program?

list1 = [1,2,3,4] list2 = [2,4,5,6] list3 = [2,6,7,8] result = list() result.extend(i for i in list1 if i not in (list2+list3) and i not in result) result.extend(i for i in list2 if i not in (list1+list3) and i not in result) result.extend(i for i in list3 if i not in (list1+list2) and i not in result)
*
1 point
Which of the following Python statements will result in the output: 6?

A = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
*
1 point
Output of the following program

from math import *
a = 2.13
b = 3.7777
c = -3.12
print(int(a), floor(b), ceil(c), fabs(c))
*
1 point
Once we have defined a function, we can call it?
*
1 point
 The ______ symbol along with the name of the decorator function can be placed above the definition of the function to be decorated works as an alternate way for decorating a function.

*
1 point
What will be the output of the following Python expression?

round(4.576)
*
1 point
What is output of print(math.pow(3, 2))?
*
1 point
Which of the following is the use of id() function in python?
*
1 point
Which of the following is a Python tuple?
*
1 point
Suppose t = (1, 2, 4, 3), which of the following is incorrect?
*
1 point

What will be the output of the following Python code?

x = [[0], [1]]
print((' '.join(list(map(str, x))),))

*
1 point

What will be the output of the following Python code?

i = 1
while True:    
       if i%3 == 0:        
                  break    
       print(i)     

    i + = 1
*
1 point

What will be the output of the following Python code snippet if x=1?

x<<2

*
1 point

What is the output of the following program

   class tester:
    def __init__(self, id):
        self.id = str(id)
        id="224"
 
>>>temp = tester(12)
>>>print(temp.id)
*
1 point

What will be the output of the following Python code?

l=[1, 0, 2, 0, 'hello', '', []]
list(filter(bool, l))
*
1 point
The following python program can work with ____ parameters.
def f(x):
    def f1(*args, **kwargs):
           print("Sanfoundry")
           return x(*args, **kwargs)
    return f1
*
1 point

What will be the output of the following Python code?

print('*', "abcde".center(6), '*', sep='')
*
1 point
What will be the output of the following Python function?
len(["hello",2, 4, 6])
*
1 point
What will be the output of the following Python code snippet?
for i in [1, 2, 3, 4][::-1]:
    print(i, end=' ')
*
1 point
Which function is called when the following Python program is executed?
f = foo()
format(f)
*
1 point
What will be the output of the following Python program?
def foo(x):
    x[0] = ['def']
    x[1] = ['abc']
    return id(x)
q = ['abc', 'def']
print(id(q) == foo(q))
*
1 point
What will be the output of the following Python program?
z=set('abc')
z.add('san')
z.update(set(['p', 'q']))
z
*
1 point
What will be the value of ‘result’ in following Python program?
list1 = [1,2,3,4]
list2 = [2,4,5,6]
list3 = [2,6,7,8]
result = list()
result.extend(i for i in list1 if i not in (list2+list3) and i not in result)
result.extend(i for i in list2 if i not in (list1+list3) and i not in result)
result.extend(i for i in list3 if i not in (list1+list2) and i not in result)
*
1 point
What will be the output of the following Python code?
1.    >>>list1 = [1, 3]
2.    >>>list2 = list1
3.    >>>list1[0] = 4
4.    >>>print(list2)
*
1 point
What will be the output of the following Python code?
x = 'abcd'
for i in range(len(x)):
    print(i)
*
1 point
What will be the output of the following Python code snippet?
z=set('abc$de')
'a' in z
*
1 point
What will be the output of the following Python code?
x = [[0], [1]]
print((' '.join(list(map(str, x))),))
*
1 point
What will be the output of the following Python code?
def foo():
    try:
        return 1
    finally:
        return 2
k = foo()
print(k)
*
1 point
What will be the output of the following Python code?
class A():
    def disp(self):
        print("A disp()")
class B(A):
    pass
obj = B()
obj.disp()
*
1 point
What will be the output of the following Python code?
x=10
y=8
assert x>y, 'X too small'
*
1 point
What is the output of the following program

T = 'geeks'
a, b, c, d, e = T
b = c = '*'
T = (a, b, c, d, e)
print(T)
*
1 point
What is the output for the below program?

L = [2e-04, 'a', False, 87]
T = (6.22, 'boy', True, 554)
for i in range(len(L)):
    if L[i]:
        L[i] = L[i] + T[i]
    else:
        T[i] = L[i] + T[i]
        break
*
1 point
Which of the following declarations is incorrect in python language?
*
1 point
What is the output of the program?

D = {1 : 1, 2 : '2', '1' : 2, '2' : 3}
D['1'] = 2
print(D[D[D[str(D[1])]]])
*
1 point
Which among the following is NOT the output of the following program?


import threading
 
class thread(threading.Thread):
    def __init__(self, thread_ID, thread_name):
        threading.Thread.__init__(self)
        self.thread_ID = thread_ID
        self.thread_name = thread_name
    def run(self):
        print(self.thread_name)
         
thread1 = thread(100, "GFG ")
thread2 = thread(101, "Geeks ")
thread3 = thread(102, "GeeksforGeeks ")
 
thread1.start()
thread2.start()
thread3.start()
 
print("Exit") 
*
1 point
Submit
Clear form
Never submit passwords through Google Forms.
This content is neither created nor endorsed by Google. Report Abuse - Terms of Service - Privacy Policy