2023年1月8日
摘要: name=str(input('请输入姓名:')) age=int(input('请输入真实年龄:')) if age >= 18 : print(f'恭喜{name}可以在网上冲浪了。') else: print('小小年纪不学好,赶紧回家写作业去!') money=float(input('嘴巴 阅读全文
posted @ 2023-01-08 19:55 至清无物 阅读(34) 评论(0) 推荐(0) 编辑
摘要: #导入工具 import turtle #奥运五环 turtle.screensize(800,800) turtle.pensize(10) #中间黑色的圆 turtle.pencolor('black') turtle.circle(100) #左边蓝色的圆 turtle.penup() tur 阅读全文
posted @ 2023-01-08 19:19 至清无物 阅读(272) 评论(0) 推荐(0) 编辑
摘要: #导入工具 # import turtle #定义一个画布尺寸的两种方式 turtle.screensize(100,100) turtle.setup(800,600,700,200) #定义画笔 turtle.shape('turtle') #定义画笔颜色 turtle.pencolor('bl 阅读全文
posted @ 2023-01-08 19:12 至清无物 阅读(1666) 评论(0) 推荐(0) 编辑
摘要: time=15678 hour=time//3600 minute=time%3600//60 second=time%60 print(hour,'时',minute,'分',second,'秒') 4 时 21 分 18 秒 阅读全文
posted @ 2023-01-08 19:01 至清无物 阅读(109) 评论(0) 推荐(0) 编辑
摘要: a=10 b=20 a=a^b b=a^b a=a^b print(a,b) 返回 20 10 阅读全文
posted @ 2023-01-08 19:01 至清无物 阅读(72) 评论(0) 推荐(0) 编辑
摘要: print(ord('y'),',',ord('a')) 121 , 97 阅读全文
posted @ 2023-01-08 18:59 至清无物 阅读(16) 评论(0) 推荐(0) 编辑
摘要: # 算数运算符的区别 # 数值+布尔真为1假为0 print(1+True) # 在字符串里面+作为连接符使用 print('你'+'好'+'!') # 在字符串里面用乘号,输入该字符串三次 print('您好\n'*3) # 幂运算为前一个数的后一个数次方 print(2**3) # 除 # pr 阅读全文
posted @ 2023-01-08 18:43 至清无物 阅读(13) 评论(0) 推荐(0) 编辑
摘要: print(type(1)) 返回 int print(type('您好')) 返回 str 字符串 print(type(0>1)) 返回 bool 布尔类型 print(type(3.145)) 返回 float 浮点类型 print(type(1))# 返回 int print(type('您 阅读全文
posted @ 2023-01-08 18:40 至清无物 阅读(148) 评论(0) 推荐(0) 编辑
摘要: # 图片裁剪,需要设置边缘间距【left,upper,right,lower】 image_5=image.crop(box=(1000,1000,1000,1000)) image_5.show() 出现错误 SystemError: tile cannot extend outside imag 阅读全文
posted @ 2023-01-08 11:01 至清无物 阅读(700) 评论(0) 推荐(0) 编辑
摘要: 运行如下代码:突然出现错误。 from PIL import Image image=Image.open('./image/3.JPG') print(image) image_1=image.resize((1000,1000)) image_2=image.resize((image.size 阅读全文
posted @ 2023-01-08 10:08 至清无物 阅读(1242) 评论(0) 推荐(0) 编辑