Search Header Logo

HCI 584 Python quiz

Authored by Chris Harding

Computers

University

Used 7+ times

HCI 584 Python quiz
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

15 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Given a list numbers = [1, 2, 3, 4, 5], what is the result of numbers[1:4]?

[1, 2, 3, 4]

[1, 4]

[2, 3, 4]

[4, 3, 2]

2.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Given the dictionary person = {"name": "Alice", "age": 30}, how would you access Alice's age?

person[age]

person["Alice", "age"]

person.age

person["age"]

3.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Media Image

What is the result?

0

1

[5]

5

4.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Media Image

What is the result?

error! Needs 2 args!

4

8

15

5.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Which of the following is the correct way to comment out multiple lines of code in Python?

#

''' '''

<!-- -->

/* */

6.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Which of the following data types is immutable in Python?

list

array

dictionary

string

7.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

What does len("Hi Bob") return?

"Howdy!"

2

5

6

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?

Discover more resources for Computers