
Python Programming Quiz

Quiz
•
Computers
•
University
•
Hard
SUBBURAJ S
FREE Resource
15 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What is the purpose of variables in Python programming?
The purpose of variables in Python programming is to store and manipulate data.
The purpose of variables in Python programming is to handle exceptions.
The purpose of variables in Python programming is to display output.
The purpose of variables in Python programming is to create loops.
2.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Which of the following is a valid data type in Python? a) Integer b) Float c) String d) All of the above
c) String
b) Float
a) Integer
d) All of the above.
3.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What is the output of the following code snippet? x = 5 y = 2 print(x % y)
3
1
2
0
4.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Which control flow statement is used to execute a block of code repeatedly as long as a certain condition is true?
for
if
while
switch
5.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What is the output of the following code snippet? numbers = [1, 2, 3, 4, 5] for num in numbers: print(num)
1 2 3 4
1 2 3 4 5
1 2 3 4 5 6
1 2 3 4 5
6.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Which file mode is used to open a file for reading?
w
a
x
r
7.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What is the output of the following code snippet? file = open('data.txt', 'r') print(file.read()) file.close()
The output of the code snippet will be the file object.
The output of the code snippet will be the contents of the 'data.txt' file.
The code will throw an error because the file 'data.txt' does not exist.
The output of the code snippet will be an empty string.
Create a free account and access millions of resources
Similar Resources on Wayground
20 questions
Geeks for Geeks PCCOER Info Session CP Quiz

Quiz
•
University
20 questions
JAVA Basics Quiz

Quiz
•
University
10 questions
AdvancedProgramming_intro

Quiz
•
University
10 questions
CIS1101-programming practice2

Quiz
•
University
18 questions
HTML,CSS,SCRIPT QUIZZ

Quiz
•
University
15 questions
PROGRAMMING IN PYTHON - UNIT II - TEST 2 - MCQS

Quiz
•
University
15 questions
System Development Life Cycle

Quiz
•
University
15 questions
Knowledge Knockout[Quiz Round](2nd-4th years)

Quiz
•
University
Popular Resources on Wayground
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
10 questions
9/11 Experience and Reflections

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

Quiz
•
5th Grade
11 questions
All about me

Quiz
•
Professional Development
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
9 questions
Tips & Tricks

Lesson
•
6th - 8th Grade
Discover more resources for Computers
21 questions
Spanish-Speaking Countries

Quiz
•
6th Grade - University
20 questions
Levels of Measurements

Quiz
•
11th Grade - University
7 questions
Common and Proper Nouns

Interactive video
•
4th Grade - University
12 questions
Los numeros en español.

Lesson
•
6th Grade - University
7 questions
PC: Unit 1 Quiz Review

Quiz
•
11th Grade - University
7 questions
Supporting the Main Idea –Informational

Interactive video
•
4th Grade - University
12 questions
Hurricane or Tornado

Quiz
•
3rd Grade - University
7 questions
Enzymes (Updated)

Interactive video
•
11th Grade - University