Search Header Logo

Python Training - Basics

Authored by Nathan Swain

Computers

Professional Development

Used 4+ times

Python Training - Basics
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

The following code is an example of which data type in Python:

x = [ 1, 2, 3]

Array

List

Tuple

Dictionary

Answer explanation

Lists are created using square brackets [].

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

The following code is an example of which Python data type:

x = {"a": 1, "b": 2}

Array

List

Tuple

Dictionary

Answer explanation

The curly braces {} give it away, this is an example of a Dictionary.

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

Spaces are not important in Python.

True

False

Answer explanation

Spacing is very important in Python. Indenting code indicate blocks of code. The best practice is to indent using 4 spaces.

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

Which character is used to start a Python comment?

#

/

!

-

Answer explanation

Python was using hashtags before they were cool!

5.

MULTIPLE SELECT QUESTION

45 sec • 1 pt

Media Image

Which of the following are valid Python arithmetic operators?

$

**

//

%

Answer explanation

The supported arithmetic operators of Python are: +, -, , /, //, %, and ** .

6.

MULTIPLE SELECT QUESTION

45 sec • 1 pt

Media Image

Which of the following are valid Python comparison operators?

>

!=

=

<=

Answer explanation

A single = is the assigment operator. To compare equality, use two == .

7.

MULTIPLE SELECT QUESTION

45 sec • 1 pt

Media Image

Which of the following are valid types of loops in Python?

do

while

do while

for

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

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?