- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
Python编程根底授课讲义
_浙兰溪宋顺南
001Python语言概述
002Windows Python 安装与运行
print(Hello world!)
Hello world!
print(浙师大)
浙师大
2 + 3
5
003Python 是如何运行的
004IDLE 根本应用
print(hello)
hello
2+3
5
def yuwen(chengji):
print(yuwen{}.format(chengji))
for i in range(3):
print(chengji)
yuwen(110)
yuwen110
110
110
110
alt+p 复制上行指令
alt+n 复制下行指令
home 行首
end 行尾
options讲解
005Python 程序概念层级
006变量与动态类型
75+1
76
s=76
print(76)
76
print(s)
76
_s=80
_s
80
S=99
S
99
my_s=100
my_s
100
name
Traceback (most recent call last):
File pyshell#9, line 1, in module
name
NameError: name name is not defined
name = zhang
name
zhang
007变量与对象存储
x=20
y=Tom
x=jry
z=Tom
id(Tom) id(y) id(z) a=50
b=50
a==b
True
id(a)
1497971232
id(b)
1497971232
a is b
True
mike=8000
peter=8000
mike==peter
True
id(mike) id(peter) url= lxsz
link= lxsz
url==link
True
url is link
False
id(url) id(link)
008核心内置数据类型概述
2+3
5
type(5)
class int
type(3.14)
class float
name=Tom
type(name)
class str
l=[1,5,4,3]
x=l.sort()
x
x is None
True
x==None
True
53
True
53
False
type(53)
class bool
009整型浮点型声明及根本运算
0
0
12
12
24
24
33
33
256
256
999
999
999999999999999999999999
999999999999999999999999
-10
-10
3.14
3.14
-999
-999
3.14e5
314000.0
0b1110
14
0o176
126
0x9ff
2559
pi=3.14
x=20
3+2
5
8-2
6
3*22
66
21/7
3.0
21//7
3
22//7
3
3**2
9
2**3
8
(((1+2)*3)**4)/5
1312.2
22/7
22%7
1
010数值处理内置函数及工具模块
10+30
Traceback (most recent call last):
File pyshell#0, line 1, in module
10+30
TypeError: unsupported operand type(s) for +: int and str
10+int(30)
40
10+int(1110,2)
24
int(176,8)
126
int(9ff,16)
2559
3.14*2
3.143.14
float(3.14)*2
6.28
bin(10)
0b1010
hex(10)
0xa
oct(10)
0o12
21/7
3.0
22/7
22//7
3
x=22/7
x
import math
math.floor(x)
3
math.floor(3.99)
3
math.floor(-3.14)
-4
math.trunc(3.14)
3
math.trunc(3.99)
3
math.trunc(-3.99)
-3
math.ceil(3
原创力文档


文档评论(0)