Python Programming Essentials Quiz

Quiz
•
Computers
•
12th Grade
•
Medium
Regita Permata
Used 1+ times
FREE Resource
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is a valid variable name in Python?
1variable
_variable
variable-1
variable!
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the data type of the variable 'x' in the following code? x = 5.5
int
float
string
boolean
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following code? if x > 5: print('Hello') else: print('World')
Hello
World
Hello World
No output
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How many times will the following loop execute? for i in range(5): print(i)
0
1
4
5
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the correct way to define a function in Python?
def myFunction()
function myFunction()
myFunction()
function myFunction:
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the value of x after executing the following code? def myFunction(x): x += 5 return x x = 10 myFunction(x)
5
10
15
20
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following code? def myFunction(x, y): return x + y print(myFunction(2, 3))
2
3
5
6
Create a free account and access millions of resources
Similar Resources on Wayground
11 questions
Python Inputs

Quiz
•
9th - 12th Grade
10 questions
PCEP Section 4B: the function and its environment

Quiz
•
12th Grade
15 questions
Python Programming 1: print, strings, variables, casting

Quiz
•
9th Grade - University
14 questions
Python List Basics

Quiz
•
12th Grade
15 questions
PYTHON PROGRAMMING

Quiz
•
11th - 12th Grade
10 questions
Python Testing

Quiz
•
9th - 12th Grade
15 questions
MP1 Test 1 - Objects Classes and Methods

Quiz
•
9th - 12th Grade
10 questions
RL Python Basics Quiz 1

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

Quiz
•
6th - 12th Grade
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
15 questions
Core 4 of Customer Service - Student Edition

Quiz
•
6th - 8th Grade
15 questions
What is Bullying?- Bullying Lesson Series 6-12

Lesson
•
11th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade