学习笔记
张子麒
这个作者很懒,什么都没留下…
展开
-
Python 学习笔记—自己开发小游戏的代码
学习了一段时间的python尝试开发了一些十分基础的小游戏比如猜数字猜年龄代码如下输出100-999之间的水仙花数#举例 153=111+333+555for item in range(100,1000):ge=item%10shi=item//10%10bai=item//100if ge3+shi3+bai**3==item:print(bai,shi,ge)‘’‘从键盘录入密码 最多录入三次 如果正确结束循环’’’for item in range(3):pwd=inp原创 2020-11-20 21:34:49 · 540 阅读 · 0 评论 -
python日常学习代码实操
python 的一些代码实操#print()函数的使用print(520)print(‘hello world’)print(3+1)print(chr(0b0101111110010000),chr(0b1000001001111010),chr(0b1000001000101010),)#二进制与字符编码fp=open(‘D:/xyh/xyh.txt’,‘a+’)print(chr(0b0101111110010000),chr(0b1000001001111010),chr(0b100原创 2020-11-20 21:29:36 · 908 阅读 · 0 评论 -
python 基础学习笔记
python学习笔记关于python的一点基础笔记abs(number),返回数字的绝对值cmath.sqrt(number),返回平方根,也可以应用于负数float(object),把字符串和数字转换为浮点数help(),提供交互式帮助input(prompt),获取用户输入int(object),把字符串和数字转换为整数math.ceil(number),返回数的上入整数,返回值的类型为浮点数math.floor(number),返回数的下舍整数,返回值的类型为浮点数math.sqr原创 2020-11-20 21:27:23 · 96 阅读 · 0 评论