Python Basics Quiz

Python Basics Quiz

12th Grade

15 Qs

quiz-placeholder

Similar activities

Word Module 1 Vocabulary

Word Module 1 Vocabulary

6th - 12th Grade

18 Qs

Word Module 1 Quiz

Word Module 1 Quiz

9th - 12th Grade

20 Qs

Creating and Managing a Presentation

Creating and Managing a Presentation

9th - 12th Grade

10 Qs

ITAA Unit 4: HTML

ITAA Unit 4: HTML

9th - 12th Grade

18 Qs

Inscoe - CPI 6.01-6.03

Inscoe - CPI 6.01-6.03

9th - 12th Grade

20 Qs

adobe photoshop 2015 certification quiz 2

adobe photoshop 2015 certification quiz 2

9th - 12th Grade

20 Qs

Central Bank

Central Bank

8th - 12th Grade

10 Qs

marketing applications unit 5 review part 1

marketing applications unit 5 review part 1

12th Grade

15 Qs

Python Basics Quiz

Python Basics Quiz

Assessment

Quiz

Business

12th Grade

Hard

DOK Level 1: Recall, DOK Level 2: Skill/Concept

Standards-aligned

Created by

William Cain

FREE Resource

15 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the correct syntax to output "Hello, World!" in Python?

`echo "Hello, World!"`

`print("Hello, World!")`

`printf("Hello, World!")`

`cout << "Hello, World!"`

Answer explanation

The correct syntax to output 'Hello, World!' in Python is `print("Hello, World!")`. This statement will display the text within the parentheses on the screen.

Tags

DOK Level 1: Recall

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is a valid variable name in Python?

`1variable`

`variable_1`

`variable-1`

`variable 1`

Answer explanation

In Python, variable names can contain letters, numbers, and underscores, but cannot start with a number or contain special characters like hyphens or spaces. Therefore, `variable_1` is a valid variable name.

Tags

DOK Level 1: Recall

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the following code? ```python x = 5 y = 10 print(x + y) ```

`5`

`10`

`15`

`50`

Answer explanation

The output of the code is `15` because it adds the values of `x` (5) and `y` (10) together.

Tags

DOK Level 1: Recall

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following data types is immutable in Python?

`list`

`set`

`dictionary`

`tuple`

Answer explanation

In Python, the data type 'tuple' is immutable, meaning its values cannot be changed after creation. Lists, sets, and dictionaries are mutable data types.

Tags

DOK Level 1: Recall

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

`14`

`11`

`10`

`7`

Answer explanation

The correct order of operations is to first multiply 4 by 2, then add 3. Therefore, 3 + 4 * 2 = 3 + 8 = 11.

Tags

DOK Level 1: Recall

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is the correct way to create a function in Python?

`function myFunction():`

`def myFunction():`

`create myFunction():`

`function: myFunction()`

Answer explanation

The correct way to create a function in Python is by using the 'def' keyword followed by the function name, like 'def myFunction()'.

Tags

DOK Level 1: Recall

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

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

`2`

`3`

`5`

`23`

Answer explanation

The output of the code will be `5` because the `add` function returns the sum of the two input parameters, which are 2 and 3 in this case.

Tags

DOK Level 2: Skill/Concept

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?