频道栏目
首页 > 程序开发 > Web开发 > Python > 正文
python :高级编程技术 week1-3
2018-03-12 11:51:43         来源:wyfwyf12321的博客  
收藏   我要投稿

编程技术-week1-3">python 从入门到实践 第二章 (高级编程技术 week1-3)

现在先做一下课后的习题

2-1

a='message'
print(a)

2-2

a = 'old message'
print(a)
a = 'new message'
print(a)

2-3

a = input('What's your name : ')
print('Hello ',a,' would you like to learn some Python today')

2-4

name = input('What's your name : ')
print(name.upper())
print(name.lower())
print(name.title())

2-5

print('Albert Einstein once said, “A person who never made a mistake never tried anything new.” ')

2-6

famous_persion = 'Albert Einstein'
message = famous_person + ' once said, “A person who never made a mistake never tried anything new.” '
print(message)

2-7

name = '  \n\t\n John \n\t\n  '
print(name)
print(name.lstrip())
print(name.rstrip())
print(name.strop())

2-8

print(3+5)
print(10-2)
print(2*4)
print(16/2)

2-9

my_favourite_number = 6
message = "my favourite number is " + str(my_favourite_number)
print(message)

2-10

my_favourite_number = 6
# 好像没有什么注释要加的
message = "my favourite number is " + str(my_favourite_number)
print(message)

2-11

看了一下python之禅。

\

点击复制链接 与好友分享!回本站首页
上一篇:Python实现决策树算法教程
下一篇:Python如何提取APK图标
相关文章
图文推荐
点击排行

关于我们 | 联系我们 | 广告服务 | 投资合作 | 版权申明 | 在线帮助 | 网站地图 | 作品发布 | Vip技术培训 | 举报中心

版权所有: 红黑联盟--致力于做实用的IT技术学习网站