03 2020 档案

摘要:1、序列包含:str(字符串)、len(列表)、tup(元组) 2、索引 l = [0, 1, 2, 3, 4, 'a', 'b', [123, 456], 'd', 'e'] s = 'abcdefghijklmn' t = (11,'werwer'.[23234]) # 索引,序列中的所有元素都 阅读全文
posted @ 2020-03-25 16:20 TXBB哭哭 阅读(252) 评论(0) 推荐(0)
摘要:1、关于编码方式 1.1简单认识几种编码格式 python3.X默认编码格式是UTF-8。ASCII码(python2.X默认编码格式)只适用于美国,GBK只适用于中文,UNICODE和UTF-8兼容全部的字符类型。 详细查看https://www.cnblogs.com/txbbkk/p/9291 阅读全文
posted @ 2020-03-24 19:42 TXBB哭哭 阅读(351) 评论(0) 推荐(0)
摘要:#使用%s-str类型占位符,%d-int类型占位符,%%为百分比 print('我的名字是%s,我的年龄是%d,我的身高是%d,学习进度为5%%' % ('王静', int('12'), int('155'))) #使用format方法-基础的一对一 print("我的名字是:{} ,我的年龄是{ 阅读全文
posted @ 2020-03-23 23:56 TXBB哭哭 阅读(131) 评论(0) 推荐(0)
摘要:# 1、 使用while循环输入1 2 3 4 5 6 8 9 10 count = 1 while count <= 10: if count != 7: print(count) count += 1 # 2、求1-100的和 count = 1 sum = 0 while count <=10 阅读全文
posted @ 2020-03-19 23:53 TXBB哭哭 阅读(124) 评论(0) 推荐(0)
摘要:1、条件语句 num = int(input('请输入您的年龄:')) if num >= 18: print('成年了') #如果满足if条件,则执行if冒号后一个缩进的语句 if num >= 40: print('你年纪有点大') else:print('小青年吧') elif num <10 阅读全文
posted @ 2020-03-19 23:06 TXBB哭哭 阅读(105) 评论(0) 推荐(0)
摘要:1、整数-int、浮点数float a = 2 b = 3 print(a+b) #int/float类型相加 print(a-b) #int/float类型相减 print(a*b) #int/float类型相乘 print(a/b) #int/float类型相除 print(a%b) #int/ 阅读全文
posted @ 2020-03-19 22:56 TXBB哭哭 阅读(228) 评论(0) 推荐(0)