
python 2

Quiz
•
Computers
•
12th Grade
•
Hard
M. Kumar
FREE Resource
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
Create a free account and access millions of resources
Similar Resources on Wayground
19 questions
ProA Desarrollo de Software 3° año

Quiz
•
1st - 12th Grade
24 questions
Логикалык операторлор жана структуралар

Quiz
•
6th Grade - University
18 questions
Strukturalne typy danych, operacje na plikach, klasy - Python

Quiz
•
9th Grade - University
20 questions
Python Programming Quiz

Quiz
•
9th Grade - University
16 questions
Python - Osnove objektno usmjerenog programiranja

Quiz
•
12th Grade
20 questions
Python Quiz

Quiz
•
12th Grade
18 questions
KS3 Python

Quiz
•
KG - University
17 questions
ქვ(not)იზი

Quiz
•
12th Grade
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
10 questions
UPDATED FOREST Kindness 9-22

Lesson
•
9th - 12th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
20 questions
US Constitution Quiz

Quiz
•
11th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade