You are on page 1of 4

 输入姓名后输出first name和 last name,当程序

运行时,出现“Enter the name:”后中止,请输入


单词并按下《Enter》键后,显示输入名字的first
name和 last name。
以5个成绩作为输入,去掉两个最低分后给出平均值。
这些成绩放入列表grades中,最低的两个成绩移除,
然后使用sum和len函数计算剩余成绩的平均值
 给出下列代码的输出:
L=[“sequence”, “contains”, ”five”, ”words.”]
L.insert(0,”this”)
print(“ ”.join(L))
del L[3]
L.insert(3,”six”)
L.insert(4, “different”)
print(“ ”.join(L))
(1) 创建一个名为test.txt文件
(2) 写入“1,Say hello,to Python,lesson!”
(3)重新读出文件内容
(4)使用空格作为分隔符将字符串划分成3个子串
(5)将每个每个子串变成一个元组
(6)将所有元组组成一个列表

You might also like