摘要: Python — 2.基本数据类型 # 1、数字类型 # (1)测试类型函数:type() # (2)十进制转换为二进制数:bin() bin(4) '0b100' # (3)十进制转换为八进制数:oct() oct(45) '0o55' # (4)十进制转换为十六进制:数hex() hex(45) 阅读全文
posted @ 2020-11-03 11:41 淇凌 阅读(67) 评论(0) 推荐(0) 编辑
摘要: Python — 1.基本语法 # 1、条件语句 # (1)if-else a='python' if a == 'python': # 判断变量是否为 python flag = True # 条件成立时设置标志为真 print('welcome boss') # 并输出欢迎信息 else: pr 阅读全文
posted @ 2020-11-03 11:10 淇凌 阅读(35) 评论(0) 推荐(0) 编辑
摘要: Python — 3.time库 from time import * # (1)时间获取: time() # 系统内(浮点数) ctime() # 人类可读(字符串) gmtime() # 计算机可处理的时间格式 # print(time()) # (2)时间格式化: strftime() # t 阅读全文
posted @ 2020-11-03 11:07 淇凌 阅读(27) 评论(0) 推荐(0) 编辑