python MCQ

python MCQ

Professional Development

5 Qs

quiz-placeholder

Similar activities

PWC_Python_Day2

PWC_Python_Day2

Professional Development

10 Qs

Tuples in Python

Tuples in Python

Professional Development

9 Qs

Flutter_Q5

Flutter_Q5

Professional Development

10 Qs

Simple Easy Basic Lua Quiz

Simple Easy Basic Lua Quiz

4th Grade - Professional Development

10 Qs

Day-2 IOAC - ML  Python Assessment_5th-Feb-2023

Day-2 IOAC - ML Python Assessment_5th-Feb-2023

Professional Development

10 Qs

Python Basics - First step of Baby python

Python Basics - First step of Baby python

Professional Development

10 Qs

Java_4

Java_4

Professional Development

6 Qs

TalentNext Test Day-13-Core Java Topics

TalentNext Test Day-13-Core Java Topics

Professional Development

10 Qs

python MCQ

python MCQ

Assessment

Quiz

Professional Development

Professional Development

Hard

Created by

Assistant Chennai

Used 11+ times

FREE Resource

5 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

what is the output of following code?

def func(n):

if(n==1):

return 1;

else:

return(n+func(n-1))

print(func(4))

A - 12

B - 10

C - 9

D - 11

2.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

guess the output?

def main():

try:

func()

print(''print this after function call'')

except ZeroDivisionError:

print('Divided By Zero! Not Possible! ')

except:

print('Its an Exception!')

def func():

print(1/0)

main()

‘Its an Exception!’

'Divided By Zero! Not possible!’

‘print this after function call’ followed by ‘Divided By Zero! Not Possible!’

‘print this after function call’ followed by ‘Its an Exception!’

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

predict the output?

count = 1


def doThis():


global count


for i in (1, 2, 3):

count += 1


doThis()


print (count)

4

5

3

2

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

what is the output of following code?

sum = 0

for i in range(12,2,-2):

sum+=i

print sum

41

39

40

42

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How many times are the following loops executed?

i=100

while(i<=200):

print i

i+=20

20

5

6

7