Search Header Logo

Python Tuples Quiz

Authored by Shiwen Zhang

Computers

University

Used 1+ times

Python Tuples 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

30 sec • 1 pt

下面哪一个是元组?

thistuple = 'apple, banana, cherry'

thistuple = {'apple', 'banana', 'cherry'}

thistuple = ('apple', 'banana', 'cherry')

thistuple = ['apple', 'banana', 'cherry']

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

下面哪个代码可以在python里面表示一个元组?

tuple = '1, 2, 3'

tuple = {1, 2, 3}

tuple = [1, 2, 3]

tuple = (1, 2, 3)

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

以下哪项不是元组的特征?

元组是有序集合。

元组可以包含重复元素。

元组在创建后可以修改。

元组是不可变的。

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

哪种数据结构用于将多个项目存储在一个变量中?

元组

字符串

整数

浮点数

5.

FILL IN THE BLANK QUESTION

1 min • 1 pt

使用正确的语法打印水果元组中的元素数量

fruits = ("apple", "banana", "cherry")

print(________)

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

您可以通过引用索引号来访问元组中的元素,那么第一个元素的索引号是多少?

1

0

-1

7.

FILL IN THE BLANK QUESTION

1 min • 1 pt

完善对应的语法,使代码可以输出元组fruits里面的第一个元素

fruits = ("apple", "banana", "cherry")

print(_______)

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