日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程语言 > python >内容正文

python

Coursera课程Python for everyone:chapter8

發(fā)布時間:2025/3/21 python 30 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Coursera课程Python for everyone:chapter8 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

Chapter 8 Quiz

10?試題

1.?

How are "collection" variables different from normal variables?

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

2.?

What are the Python keywords used to construct a loop to iterate through a list?

def / return

foreach / in

try / except

for / in

3.?

For the following list, how would you print out 'Sally'?

friends = [ 'Joseph', 'Glenn', 'Sally' ]

print friends[2:1]

print friends['Sally']

print friends[3]

print friends[2]

4.?

What would the following Python code print out?

fruit = 'Banana' fruit[0] = 'b' print fruit

b

banana

B

Nothing would print - the program fails with a traceback

[0]

Banana

5.?

Which of the following Python statements would print out the length of a list stored in the variabledata?

print data.length()

print len(data)

print strlen(data)

print length(data)

print data.length

print data.Len

6.?

What type of data is produced when you call the?range()?function?

x = range(5)

A boolean (true/false) value

A string

A list of integers

A list of characters

A list of words

7.?

What does the following Python code print out?

a = [1, 2, 3] b = [4, 5, 6] c = a + b print len(c)

[1, 2, 3]

15

21

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

[4, 5, 6]

6

8.?

Which of the following slicing operations will produce the list [12, 3]?

t = [9, 41, 12, 3, 74, 15]

t[:]

t[12:3]

t[2:2]

t[1:3]

t[2:4]

9.?

What list method adds a new item to the end of an existing list?

pop()

index()

push()

add()

append()

forward()

10.?

What will the following Python code print out?

friends = [ 'Joseph', 'Glenn', 'Sally' ] friends.sort() print friends[0]

Joseph

Sally

Glenn

friends

總結(jié)

以上是生活随笔為你收集整理的Coursera课程Python for everyone:chapter8的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。