Python Quiz

Python Quiz

12th Grade

15 Qs

quiz-placeholder

Similar activities

Penilian Harian 2 Editing Video

Penilian Harian 2 Editing Video

9th - 12th Grade

10 Qs

Threats to Data

Threats to Data

9th - 12th Grade

11 Qs

1.1.1 The structure and function of the processor

1.1.1 The structure and function of the processor

11th Grade - University

15 Qs

COMPUTER PROGRAMMING Q2_FLOWCHART (2 points each)

COMPUTER PROGRAMMING Q2_FLOWCHART (2 points each)

11th - 12th Grade

10 Qs

Remidi UTS AIJ

Remidi UTS AIJ

12th Grade

20 Qs

Arduino Loop

Arduino Loop

2nd Grade - University

20 Qs

Python List

Python List

4th Grade - University

15 Qs

QUIZ BAB 4: SISTEM OPERASI

QUIZ BAB 4: SISTEM OPERASI

8th Grade - University

20 Qs

Python Quiz

Python Quiz

Assessment

Quiz

Computers

12th Grade

Practice Problem

Hard

DOK Level 1: Recall, DOK Level 2: Skill/Concept, DOK Level 3: Strategic Thinking

Standards-aligned

Created by

Jamisha McClain-Raymond

Used 1+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

15 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

Elijah, Ava, and Abigail are learning Python together. They came across this line of code: `print(type([1, 2, 3]))`. What will it output?

``

``

``

``

Answer explanation

The output of the code snippet is '', which indicates that the type of the object [1, 2, 3] is a list.

Tags

DOK Level 1: Recall

2.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

Hey there, Charlotte! If you were to store a lovely poem or a fun story in Python, which data type would you typically use?

List

Dictionary

String

Tuple

Answer explanation

The Python data type typically used for storing textual data is String.

Tags

DOK Level 1: Recall

3.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

Imagine Isla, Maya, and Emma are playing a game where they need to guess the number of unique numbers in a list. They are given the list [1, 2, 2, 3, 4, 4, 4]. What will `len(set([1, 2, 2, 3, 4, 4, 4]))` return?

7

4

5

3

Answer explanation

The code creates a set from the list [1, 2, 2, 3, 4, 4, 4], which removes duplicates. The set will have elements [1, 2, 3, 4], so the length of the set is 4.

Tags

DOK Level 2: Skill/Concept

4.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

What does the `if` statement do in Python?

It loops through a block of code a specified number of times.

It stops the execution of the program.

It executes a block of code if a specified condition is true.

It declares a variable.

Answer explanation

The `if` statement in Python executes a block of code if a specified condition is true, highlighting the correct choice.

Tags

DOK Level 1: Recall

5.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

What will be the output of the following code snippet? ```python x = 10 if x > 5: print("Greater") else: print("Smaller") ```

Greater

Smaller

Error

No output

Answer explanation

The code snippet checks if x is greater than 5, which is true (x=10), so it prints 'Greater'. Therefore, the correct output is 'Greater'.

Tags

DOK Level 2: Skill/Concept

6.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

Which Python keyword is used to define a function?

`function`

`def`

`func`

`declare`

Answer explanation

The Python keyword used to define a function is `def`. It is used at the beginning of a function definition to indicate the start of the function block.

Tags

DOK Level 1: Recall

7.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

Evelyn is working on a Python project and needs to calculate the square root of a number. Which syntax should she use to correctly return the square root in her function?

`return sqrt(x)`

`return x ** 0.5`

`return x^2`

`return x * x`

Answer explanation

The correct syntax to return the square root of a number in a Python function is 'return x ** 0.5'.

Tags

DOK Level 2: Skill/Concept

Create a free account and access millions of resources

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?