当前位置:   article > 正文

python从入门到实践课后作业第3章_python第三章作业(初级)

python第三章作业(初级)

python从入门到实践课后作业第3章


python从入门到精通第三章的课后作业(自己练习)


作业3-1
# names=['rourou','daidai','magua','xialingdang','xiaowangzi','xiaohezi']
# print(names)
# 作业3-2
# for name in names:
#     print('Hello,'+name+'!')
# 作业3-3
# traffic_ways=['car','bus','on foot','motorcycle','bike']
# for traffic_way in traffic_ways:
#       print('I would like to go to work by '+traffic_way+'.')
# 作业3-4、3-5、3-6、3-7
# names=['yayay','goup','sanfa']
# for name in names:
#         print('I want to have dinner with '+name.title())
# print(names[1].title()+' can not come')
# names[1]='sdfej'
# for name in names:
#         print('I want to have dinner with '+name.title())
# names.append('wisnf')
# names.insert(2,'miena')
# for name in names:
#         print('I want to have dinner with '+name.title())
# a=names.pop()
# print('sorry,'+a+'cannot come')
# b=names.pop()
# print('sorry,'+b+'cannot come')
# c=names.pop()
# print('sorry,'+c+'cannot come')
# for name in names:
#         print(name.title()+'can come as promissed')
# del names[0]
# names.remove('sdfej')
# print(names)
# 作业3-8、3-9
# spots=['yunnan','hainan','xiamen','fujian','chengdu']
# print(sorted(spots,reverse=True))
# print(spots)
# spots.reverse()
# print(spots)
# spots.reverse()
# print(spots)
# spots.sort()
# print(spots)
# spots.sort(reverse=True)
# print(spots)
# print(len(spots))
# 作业3-11
# print(spots[-1])
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/知新_RL/article/detail/386845
推荐阅读
相关标签
  

闽ICP备14008679号