您的位置:首页 > 编程语言 > Python开发

Coursera课程Python for everyone:chapter8

2016-02-17 11:13 357 查看


Chapter 8 Quiz

10 试题

Collection variables pull multiple network documents together

Collection variables merge streams of output into a single stream

Collection variables can store multiple values in a single variable

Collection variables can only store a single value

def / return

foreach / in

try / except

for / in

print friends[2:1]

print friends['Sally']

print friends[3]

print friends[2]

b

banana

B

Nothing would print - the program fails with a traceback

[0]

Banana

print data.length()

print len(data)

print strlen(data)

print length(data)

print data.length

print data.Len

A boolean (true/false) value

A string

A list of integers

A list of characters

A list of words

[1, 2, 3]

15

21

[1, 2, 3, 4, 5, 6]

[4, 5, 6]

6

t[:]

t[12:3]

t[2:2]

t[1:3]

t[2:4]

pop()

index()

push()

add()

append()

forward()

Joseph

Sally

Glenn

friends
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息