
python MCQ
Authored by Assistant Chennai
Professional Development
Professional Development
Used 11+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
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
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
10 questions
C Structures
Quiz
•
Professional Development
10 questions
Python Functions
Quiz
•
Professional Development
10 questions
Quiz RA QA
Quiz
•
Professional Development
10 questions
Cartões Recarregáveis 2.0
Quiz
•
Professional Development
10 questions
Digital Marketing
Quiz
•
Professional Development
10 questions
Brakes 2
Quiz
•
Professional Development
10 questions
PreTrainingExceptions
Quiz
•
Professional Development
10 questions
ISO 9001:2015
Quiz
•
Professional Development
Popular Resources on Wayground
5 questions
This is not a...winter edition (Drawing game)
Quiz
•
1st - 5th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
10 questions
Identify Iconic Christmas Movie Scenes
Interactive video
•
6th - 10th Grade
20 questions
Christmas Trivia
Quiz
•
6th - 8th Grade
18 questions
Kids Christmas Trivia
Quiz
•
KG - 5th Grade
11 questions
How well do you know your Christmas Characters?
Lesson
•
3rd Grade
14 questions
Christmas Trivia
Quiz
•
5th Grade
20 questions
How the Grinch Stole Christmas
Quiz
•
5th Grade