
python 2
Quiz
•
Computers
•
12th Grade
•
Practice Problem
•
Hard
M. Kumar
FREE Resource
Enhance your content in a minute
20 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What is the output of the following code?
print(str(True),end = ” “)
int(“4.5”)
True SyntaxError
'True' ValueError
True 4
SyntaxError SyntaxError
2.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Which of the following coding blocks gives the output as “Python”?
a.
def fun1():
name=”a”
def fun2():
nonlocal name
name=”PythonGeeks”
fun2()
print(name)
fun1()
b.
def fun1():
name=”a”
def fun2():
nonlocal name
name=”PythonGeeks”
print(name)
fun1()
c.
def fun1():
name=”a”
def fun2():
name=”PythonGeeks”
fun2()
print(name)
fun1()
d.
def fun1():
name=”a”
def fun2():
nonlocal name=”PythonGeeks”
fun2()
print(name)
fun1()
a
b
c
d
3.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Which of the following codes do not give any error and follow the good practices of naming?
a.
a=3
b=4
sum=a+b
print(sum)
b.
num1=3
num-2=4
sum=num1+num-2
print(sum)
c.
num1=3
num2=4
sum=a+b
print(Sum)
a
b
c
none
4.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What could be the output?
19
4
13
none
5.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What will be the output of the following code?
from decimal import Decimal as D
print(D(7.2)-D(4.1))
3.1
-3.1
3.100000000000000532907051820
Error
6.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What is the output of the following code?
print(not(True and False or True),end=" ")
print(not True and False or True)
True False
False False
True True
False True
7.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Which of the following gives the output as 3 if
seq1=[1,3,5,3,5,7,3,0]
seq2=(1,3,5,3,5,7,3,0)
seq1[-5]
seq2.count(3)
len(seq2[2:5])
All the above
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
16 questions
understanding print PROCESSES 2
Quiz
•
9th - 12th Grade
17 questions
Warstwa transportowa
Quiz
•
12th Grade
16 questions
Principles of Information Technology
Quiz
•
9th Grade - University
18 questions
SEMI-Grier Unit 3.01-3.03
Quiz
•
9th - 12th Grade
20 questions
Key Applications 2
Quiz
•
9th - 12th Grade
19 questions
Computer Languages
Quiz
•
12th Grade
19 questions
Unit 1 Digital Information Review
Quiz
•
9th - 12th Grade
22 questions
Programming Review
Quiz
•
9th - 12th Grade
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
20 questions
Figurative Language Review
Quiz
•
6th Grade
