摘要: 1 # -*- coding:utf-8 -*- 2 # 内嵌函数 3 # abs 返回数值的绝对值 4 # 5 # # num = -10 6 # print(abs(num)) 7 8 # # 最大值 max 最小值 min 9 # print(max(1,2,3)) 10 11 # round 阅读全文
posted @ 2018-08-04 16:03 goodyoung 阅读(179) 评论(0) 推荐(0) 编辑
摘要: 1 # _*_encoding:utf8_*_ 2 # 3 # 4 # # 非原始字符串 5 # # 使用单引号包含的 6 # # 'abc' 7 # # str1 = 'aaa' 8 # # print(str1, type(str1)) 9 # 10 # 11 # # 使用双引号包含的 12 # 阅读全文
posted @ 2018-08-04 15:58 goodyoung 阅读(257) 评论(0) 推荐(0) 编辑
摘要: 1 # 导入random模块 2 import random 3 # randint 确定范围随机取整数 4 result = random.randint(1,500) 5 count = 0 # 记录猜的次数 6 while True: 7 count += 1 8 9 num = int(input("请输入一个数值:")) 10 11 #... 阅读全文
posted @ 2018-08-04 10:52 goodyoung 阅读(147) 评论(0) 推荐(0) 编辑