Search Header Logo

Python Basics Challenge

Authored by Rubies Technologies

Other

8th Grade

Used 2+ times

Python Basics Challenge
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

23 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

15 mins • 1 pt

What are the basic data types in Python?

char, decimal, array, object

int, float, str, bool, list, tuple, set, dict

integer, real, text, map

string, number, boolean, collection

2.

MULTIPLE CHOICE QUESTION

15 mins • 1 pt

What is the output of the expression 5 + 3 * 2?

11

8

16

10

3.

MULTIPLE CHOICE QUESTION

15 mins • 1 pt

How do you create a list in Python?

You create a list in Python by using the list() function, e.g., my_list = list(1, 2, 3).

You create a list in Python using parentheses, e.g., my_list = (1, 2, 3).

You create a list in Python using curly braces, e.g., my_list = {1, 2, 3}.

You create a list in Python using square brackets, e.g., my_list = [1, 2, 3].

4.

MULTIPLE CHOICE QUESTION

15 mins • 1 pt

What method would you use to add an item to the end of a list?

push()

append()

add()

insert()

5.

MULTIPLE CHOICE QUESTION

15 mins • 1 pt

What is the difference between a list and a tuple?

A list is defined with {}, while a tuple is defined with []

A list is immutable and defined with [], while a tuple is mutable and defined with ().

A list can only contain numbers, while a tuple can contain any data type.

A list is mutable and defined with [], while a tuple is immutable and defined with ().

6.

MULTIPLE CHOICE QUESTION

15 mins • 1 pt

Charlotte has a list of her favorite books named 'my_list'. How does she access the first book in that list?

my_list.first()

my_list[1]

first(my_list)

my_list[0]

7.

MULTIPLE CHOICE QUESTION

15 mins • 1 pt

Aria is playing a game where she needs to pick a random number between 1 and 10. What does the random.randint(1, 10) function do in this context?

It returns a random integer N such that N < 1 or N > 10.

It returns a random integer N such that 1 <= N <= 10.

It selects a random element from a list of integers between 1 and 10.

It generates a random float between 1 and 10.

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?