Python Basics Quiz

Python Basics Quiz

8th Grade

15 Qs

quiz-placeholder

Similar activities

Lesson 31 Test-4

Lesson 31 Test-4

5th - 8th Grade

15 Qs

Python Basics Quiz

Python Basics Quiz

6th - 10th Grade

15 Qs

ICT Python class 7

ICT Python class 7

6th - 8th Grade

20 Qs

Python Quiz

Python Quiz

6th - 10th Grade

20 Qs

Lesson 25 - datetime module

Lesson 25 - datetime module

5th - 8th Grade

10 Qs

August Quiz Python

August Quiz Python

6th - 12th Grade

20 Qs

Pythton

Pythton

5th - 12th Grade

10 Qs

Python-ICT

Python-ICT

8th Grade

20 Qs

Python Basics Quiz

Python Basics Quiz

Assessment

Quiz

Education

8th Grade

Hard

Created by

C Patalano

FREE Resource

15 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the data type of the value `True` in Python?

String

Integer

Boolean

Float

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is a mutable data type in Python?

Tuple

String

List

Integer

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following code? ```python x = 5 if x > 3: print("Hello") else: print("Goodbye") ```

Goodbye

Hello

Error

None of the above

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is the correct syntax for a `for` loop in Python?

`for i in range(10):`

`for (i = 0; i < 10; i++):`

`for i to 10:`

`for i in 10:`

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the following code? ```python def add(a, b): return a + b print(add(2, 3)) ```

23

5

Error

None of the above

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you access the third element in a list named `my_list`?

`my_list[2]`

`my_list[3]`

`my_list[1]`

`my_list[0]`

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is not a valid data type in Python?

Integer

Float

Character

Boolean

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?