

Python quiz
Presentation
•
Engineering
•
University
•
Practice Problem
•
Hard
JAGARLAMUDI 23BCE9726
Used 3+ times
FREE Resource
0 Slides • 15 Questions
1
Multiple Choice
What is the correct syntax to print a string in Python?
echo "Hello, World!"
print("Hello, World!")
printf("Hello, World!")
System.out.println("Hello, World!")
2
Multiple Choice
How do you create a list in Python?
{1, 2, 3}
(1, 2, 3)
[1, 2, 3]
list(1, 2, 3)
3
Multiple Choice
Which library is used for data manipulation and analysis in Python?
NumPy
Pandas
Matplotlib
SciPy
4
Multiple Choice
How do you create a tuple in Python?
[1, 2, 3]
{1, 2, 3}
(1, 2, 3)
tuple[1, 2, 3]
5
Multiple Choice
Which of the following is NOT a valid Python data type?
int
float
double
str
6
Multiple Choice
How do you install an external Python library?
install library_name
python -m pip install library_name
include library_name
library_name install
7
Multiple Choice
What is the output of print(type([]))?
<class 'list'>
<type 'list'>
list
[]
8
Multiple Choice
How do you start a for loop in Python?
for (i=0; i<10; i++)
for i in range(10):
for i = 1 to 10:
foreach (i in 10)
9
Multiple Choice
What is the output of print(10 // 3)?
3.33
3
4
None
10
Multiple Choice
What is the correct way to write a conditional statement in Python?
if x > y {}
if x > y:
if x > y then:
if (x > y):
11
Multiple Choice
What will be the output of the following code snippet?
def foo(x=[]):
x.append(1)
return x
print(foo())
print(foo())
[1] [1]
[1] [2]
[1] [1, 1]
[1] [1, 2]
12
Multiple Choice
Which of the following statements about Python's Global Interpreter Lock (GIL) is TRUE?
It allows multi-threading in Python to run concurrently on multiple cores.
It prevents multiple threads from executing Python bytecodes at the same time.
It is specific to Jython and not CPython.
It is used to manage memory allocation across threads.
13
Multiple Choice
What will the following code output?
class A:
def init(self):
self.value = 10
def getattr(self, name):
if name == 'value':
return 20
raise AttributeError
a = A()
print(a.value)
10
20
AttributeError
Depends on Python version
14
Multiple Choice
What is the time complexity of list.pop(0) in Python?
O(1)
O(log n)
O(n)
O(n^2)
15
Multiple Choice
What is the difference between is and == in Python?
is checks value equality, and == checks reference equality.
Both check reference equality.
Both check value equality.
is checks reference equality, and == checks value equality.
What is the correct syntax to print a string in Python?
echo "Hello, World!"
print("Hello, World!")
printf("Hello, World!")
System.out.println("Hello, World!")
Show answer
Auto Play
Slide 1 / 15
MULTIPLE CHOICE
Similar Resources on Wayground
10 questions
SAAE
Presentation
•
KG - University
10 questions
Algebra - Lesson Distance Between Points
Presentation
•
12th Grade
11 questions
Promoción horizontal YOUTUBE 16
Presentation
•
University
12 questions
Promoción Horizontal YOUTUBE 10
Presentation
•
University
13 questions
Group Assignment
Presentation
•
University
11 questions
Economía: Módulo II - Elasticidades. Teoría del consumidor.
Presentation
•
University
10 questions
Tes Materi Penyusunan RPS
Presentation
•
University
10 questions
Evaluación Diagnóstica de Aritmética 02
Presentation
•
University
Popular Resources on Wayground
20 questions
Math Review
Quiz
•
3rd Grade
15 questions
Fast food
Quiz
•
7th Grade
20 questions
Context Clues
Quiz
•
6th Grade
20 questions
Inferences
Quiz
•
4th Grade
19 questions
Classifying Quadrilaterals
Quiz
•
3rd Grade
20 questions
Figurative Language Review
Quiz
•
6th Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
10 questions
Identify Fractions, Mixed Numbers & Improper Fractions
Quiz
•
3rd - 4th Grade
Discover more resources for Engineering
20 questions
Guess The App
Quiz
•
KG - Professional Dev...
11 questions
NFL Football logos
Quiz
•
KG - Professional Dev...
19 questions
Minecraft
Quiz
•
6th Grade - Professio...
40 questions
8th Grade Math Review
Quiz
•
8th Grade - University
20 questions
Block Buster Movies
Quiz
•
10th Grade - Professi...
10 questions
Would you rather...
Quiz
•
KG - University
40 questions
Flags of the World
Quiz
•
KG - Professional Dev...
14 questions
Superhero
Quiz
•
1st Grade - University