Python Developer : Final Round 3

0%

Python Developer Round 3 : Technical Exam AZKIUS-0982

1.This exam contains 30 Questions.

2. Total Time to attempt all the questions is 30 minutes.

3. You will be notified about your result at the end of exam.

4. Please don't switch tabs or try to copy questions, as the system will detect it and consider it as malpractice.

5. The questions contain code written in Python Language, you need to choose the correct output.

Good Luck for your exam!

1 / 30

What will be the output of the following program:

dictionary = {}
dictionary[1] = 1
dictionary['1'] = 2
dictionary[1] += 1
 
sum = 0
for k in dictionary:
    sum += dictionary[k]
 
print (sum)

2 / 30

counter = {}
def addToCounter(country):
    if country in  counter:
        counter[country] += 1
    else:
        counter[country] = 1
addToCounter('China')
addToCounter('Japan')
addToCounter('china')
print len(counter)

3 / 30

class Acc:
    def __init__(self, id):
        self.id = id
        id = 555
acc = Acc(111)
print acc.id

4 / 30

check1 = ['Learn', 'Quiz', 'Practice', 'Contribute']
check2 = check1
check3 = check1[:]
 
check2[0] = 'Code'
check3[1] = 'Mcq'
 
count = 0
for c in (check1, check2, check3):
    if c[0] == 'Code':
        count += 1
    if c[1] == 'Mcq':
        count += 10
 
print (count)

5 / 30

def addToList(listcontainer):
    listcontainer += [10]
 
mylistContainer = [10, 20, 30, 40]
addToList(mylistContainer)
print len(mylistContainer)

6 / 30

nameList = ['Harsh', 'Pratik', 'Bob', 'Dhruv']
 
print nameList[1][-1]

7 / 30

count = 1
 
def doThis():
 
    global count
 
    for i in (1, 2, 3): 
        count += 1
 
doThis()
 
print (count)

8 / 30

a = True
b = False
c = False
 
if not a or b:
    print (1)
elif not a or not b and c:
    print (2)
elif not a or b or not b and a:
    print (3)
else:
    print (4)

9 / 30

a = True
b = False
c = False
 
if a or b and c:
    print ("HELLO")
else:
    print ("hello")

10 / 30

What will be the output of the following program:

r = lambda q: q * 2
s = lambda q: q * 3
x = 2
x = r(x)
x = s(x)
x = r(x)
print (x)

11 / 30

Study the following program:

        x = 1
        while True:
         if x % 5 = = 0:
        break
        print(x)
        x + = 1

What will be the output of this code?

12 / 30

 Study the following function:

all([2,4,0,6])

What will be the output of this function?

13 / 30

Which of the following is correctly evaluated for this function?

pow(x,y,z)

14 / 30

 Study the following function:

round(4.576)

What will be the output of this function?

15 / 30

Which one of the following has the highest precedence in the expression?

16 / 30

Which of the following functions is a built-in function in python language?

17 / 30

Which one of the following has the same precedence level?

18 / 30

Which of the following precedence order is correct in Python?

19 / 30

Which of the following declarations is incorrect in python language?

20 / 30

Which of the following statements is correct for variable names in Python language?

 

21 / 30

Which of the following is not a keyword in Python language?

22 / 30

Why does the name of local variables start with an underscore discouraged?

23 / 30

Which of the following declarations is incorrect?

24 / 30

What is the method inside the class in python language?

25 / 30

Which of the following statements is correct in this python code?

class Name:
    def __init__(javatpoint):
        javajavatpoint = java
         name1=Name("ABC")
           name2=name1

26 / 30

Which of the following statements is correct regarding the object-oriented programming concept in Python?

27 / 30

 Which character is used in Python to make a single line comment?

28 / 30

What do we use to define a block of code in Python language?

29 / 30

Which one of the following is the correct extension of the Python file?

30 / 30

Who developed the Python language?