
PYTHON QUIZ-I
Authored by SRINIVASARAO 22PHD7042
Computers
University
Used 1+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
20 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
1.What is the output of the following code?
numbers = [1, 2, 3]
for num in numbers:
if num == 2:
break
print(num)
1
12
123
None
2.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
2.What is the output of the following code?
x = 10
if x > 5:
print("x is greater than 5")
else:
print("x is less than or equal to 5")
x is greater than 5
x is less than or equal to 5
Error
None
3.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
3.Which of the following statements is true about while loops in Python?
3.Which of the following statements is true about while loops in Python?
The loop executes a fixed number of times.
The loop executes as long as the condition is true.
The loop executes only once.
The loop condition is optional.
4.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
4.What is the output of the following code?
def multiply(a, b=2):
return a * b
print(multiply(3))
4.What is the output of the following code?
def multiply(a, b=2):
return a * b
print(multiply(3))
6
3
Error
None
5.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
5.What is the correct way to open a file in write mode?
5.What is the correct way to open a file in write mode?
open('file.txt', 'r')
open('file.txt', 'w')
open('file.txt', 'rw')
open('file.txt')
6.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
6.Which of the following statements about Python functions is false?
Functions can return multiple values.
Functions can have default parameters.
A function must always have a return statement
Functions can be nested inside other functions.
7.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
7.What will be the output of this code?
x = 5 while x > 0: print(x, end=" ") x -= 1
5 4 3 2 1
5 4 3 2 1 0
5 4 3 2
None
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
20 questions
DI (EM24) - Diseño de Contenidos (T8)
Quiz
•
University - Professi...
15 questions
Cuestionario sobre seguridad en línea
Quiz
•
2nd Grade - University
20 questions
COA_QUIZ_UNIT I
Quiz
•
University
21 questions
CPA MS-Office Hotkeys Quiz
Quiz
•
8th Grade - Professio...
15 questions
ASK T3 2.1 Kriptografi dalam Keselamatan Data
Quiz
•
University
16 questions
Algo Quiz
Quiz
•
University
20 questions
UNIT IV Normalization
Quiz
•
University
20 questions
Data & Signal
Quiz
•
University
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