Python Basics Quiz for Grade 10

Python Basics Quiz for Grade 10

10th Grade

20 Qs

quiz-placeholder

Similar activities

Learn About Snakes

Learn About Snakes

KG - 12th Grade

15 Qs

Paper 2 - Predicted Code

Paper 2 - Predicted Code

10th Grade

20 Qs

Data Science and AI

Data Science and AI

9th - 12th Grade

20 Qs

10.6 Adv Loops

10.6 Adv Loops

10th Grade

21 Qs

Science trivias

Science trivias

9th - 11th Grade

20 Qs

Lab Safety

Lab Safety

9th - 11th Grade

20 Qs

Big Idea 1

Big Idea 1

10th Grade

15 Qs

Genetic Code Common to All

Genetic Code Common to All

7th Grade - University

15 Qs

Python Basics Quiz for Grade 10

Python Basics Quiz for Grade 10

Assessment

Quiz

Science

10th Grade

Medium

Created by

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

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?