
Python Basics Quiz for Grade 10

Quiz
•
Science
•
10th Grade
•
Medium
BHARAT MEHTA
Used 1+ times
FREE Resource
20 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following Python code snippet? ```python print("Hello, World!"[7]) ```
H
W
o
,
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is a valid way to declare an integer variable in Python?
`int number = 5`
`number = 5`
`integer number = 5`
`num = "5"`
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following code? ```python import random print(random.randint(1, 10)) ```
A random integer between 1 and 10, inclusive
A random integer between 1 and 9, inclusive
A random float between 1 and 10
A random float between 0 and 1
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Consider the following list: `fruits = ["apple", "banana", "cherry"]`. What is the result of `fruits[1]`?
apple
banana
cherry
None
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the purpose of a for loop in Python?
To execute a block of code once
To execute a block of code a specific number of times
To execute a block of code while a condition is true
To define a function
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is a correct way to define a dictionary in Python?
`my_dict = {"name": "Alice", "age": 25}`
`my_dict = ["name", "Alice", "age", 25]`
`my_dict = ("name", "Alice", "age", 25)`
`my_dict = {"name", "Alice", "age", 25}`
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
16
13
11
10
Create a free account and access millions of resources
Similar Resources on Wayground
24 questions
Python Quiz for Grade 8

Quiz
•
8th Grade - University
20 questions
Incomplete and Codominance

Quiz
•
10th - 12th Grade
20 questions
Lab Safety

Quiz
•
9th - 11th Grade
20 questions
Environmental Science- Biomes

Quiz
•
9th - 12th Grade
15 questions
Vertebrate Classification

Quiz
•
5th Grade - University
15 questions
Health Science Legal and Ethical

Quiz
•
10th - 12th Grade
15 questions
Big Idea 1

Quiz
•
10th Grade
20 questions
Principles of Computer Science

Quiz
•
10th - 12th Grade
Popular Resources on Wayground
11 questions
Hallway & Bathroom Expectations

Quiz
•
6th - 8th Grade
20 questions
PBIS-HGMS

Quiz
•
6th - 8th Grade
10 questions
"LAST STOP ON MARKET STREET" Vocabulary Quiz

Quiz
•
3rd Grade
19 questions
Fractions to Decimals and Decimals to Fractions

Quiz
•
6th Grade
16 questions
Logic and Venn Diagrams

Quiz
•
12th Grade
15 questions
Compare and Order Decimals

Quiz
•
4th - 5th Grade
20 questions
Simplifying Fractions

Quiz
•
6th Grade
20 questions
Multiplication facts 1-12

Quiz
•
2nd - 3rd Grade