python3
stephen的大飞哥
一个不懂就查的软件爱好者
展开
-
python 数据类型之字符串
String (字符串)若干个字母组成的一段文本 单引号 双引号 三引号 单引号 name = 'Stphen' print(name) name = 'abcdefghijklmnok' print(name) name = '' print(name) 双引号 name = "Stephen" print(name) name = "" print(name) name = "Stephen is a coder,but not a special 'program coder'" pri原创 2021-09-18 12:13:11 · 113 阅读 · 0 评论 -
python 数据类型之数字
字数类型 1.int 2.float 3.complex int 整数 #正整数 i1 = 1000000000000000000000000000000000000000000000000000000 #负整数 i2 = -1000000000000000000000000000000000000000000000000 #二进制(binary) 每位只能出现0-1 i3 = 0b01010101 # 1 + 4 + 16 + 64 = 85 #八进制(oct) 每位只能出现0-7 i4 = 0o12原创 2021-09-18 11:54:29 · 279 阅读 · 0 评论 -
python 变量定义及数据类型
#变量定义 ##变量名 = 值 a = 1 b = 2 c = 3.0 d = 'name' e = "test" f = ''' hi , how are you''' 变量名规则: a-z A-Z, 0-9, _ 不能以数字开头,且不能是保留字,(保留字就是python 中已经用的了单词,一般是小写单词,比如,已经见过的print,别的暂时不出现,等全部介绍完,再系统的回顾一下保留字) 现在定义变量就是用字母加数字组合就ok了,保留字一定不会有这种。 例子: abcd = 1 aBC = 2 _原创 2021-09-18 11:28:40 · 204 阅读 · 0 评论 -
Python3 入门
打印内容 print(“Hello python”) 注释。 python 中使用# 来表示注释 …在这里插入代码片 #this is the python start print("# is the python comment") #this is the comment print(“py number contains int”) #this is the python end … ...原创 2021-09-18 11:01:18 · 121 阅读 · 0 评论
分享