为了账号安全,请及时绑定邮箱和手机立即绑定
课程 \ Python3 入门教程(新版)

Python3 入门教程(新版)

3-9 Python的字符串切片
# Enter a code
s='AABCDEFGHHIJ'
a=s[1:9]
print(a)
2022-03-08 查看完整代码
3-8 Python的字符串编码
# coding: utf-8
s='这是一句中英文混合的字符串:Hello World!'
print(s)
2022-03-08 查看完整代码
3-7 Python的字符串format
# Enter a code
template ='Life is {s}, you need {p}.'
short='short'
Python='Python'
result=template.format(s=short,p=Python)
print(result)
2022-03-08 查看完整代码
3-6 Python中raw字符串与多行字符串
# Enter a code
print(r'''"To be, or not to be": that is the question.
Whether it's nobler in the mind to suffer.''')
2022-03-08 查看完整代码
3-5 Python的字符串
# Enter a code
print("special string: \', \", \, \\\, \\n, \\t")
2022-02-21 查看完整代码
3-4 Python的布尔类型
# Enter a code
a = 'python'
print('hello,', a or 'world')
b = ''
print('hello,', b or 'world')
2022-02-21 查看完整代码
3-3 Python的整数与浮点数
# Enter a code
a = 3.14;
b=1.57;
c=round(a*b,2);
print(c);
2022-02-21 查看完整代码
2-2 第一个Python程序
# coding=utf-8
print('hello world')
2021-03-28 查看完整代码
首页上一页123下一页尾页
意见反馈 帮助中心 APP下载
官方微信