Search Header Logo

Python Basics Quiz for Grade 10

Authored by BHARAT MEHTA

Science

10th Grade

Used 4+ times

Python Basics Quiz for Grade 10
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

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

What is the result of the following expression: 5+3×25 + 3 \times 2 ?

16

13

11

10

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Microsoft

Continue with Microsoft

or continue with

Facebook

Facebook

Apple

Apple

Others

Others

By signing up, you agree to our Terms of Service & Privacy Policy

Already have an account?