摘要: 1.13章实例01 球 import sys import pygame pygame.init() size=width,height=640,480 screen=pygame.display.set_mode(size) color=(0,0,0) ball=pygame.image.load 阅读全文
posted @ 2021-12-16 12:41 林木森3 阅读(50) 评论(0) 推荐(0)
摘要: 1.正则表达式的点星分配 import re str1=input() str2=input() if re.match(str2,str1): print("True") else: print("False") 2.梯形法计算积分值 import math a,b = map(eval,inpu 阅读全文
posted @ 2021-12-16 12:31 林木森3 阅读(162) 评论(0) 推荐(0)
摘要: 1.一元二次方程求根 import math a = eval(input()) b = eval(input()) c = eval(input()) delta = pow(b,2) - 4*a*c if a == 0: if b == 0: print('Data error!') else: 阅读全文
posted @ 2021-12-16 12:27 林木森3 阅读(241) 评论(0) 推荐(0)
摘要: 1.跳台阶 def fun(a): total=0 firstElem=1 secondElem=2 for i in range(3,a+1): total = firstElem+secondElem firstElem = secondElem secondElem = total print 阅读全文
posted @ 2021-12-15 00:19 林木森3 阅读(411) 评论(0) 推荐(0)
摘要: 1.计算矩形面积 a = float(input()) b = float(input()) s = a * b s_S = round(s,2) print(""+str(s_S)) 2.格式化输出 s = float(input()) print("{:.3f}".format(s)) 3.字符 阅读全文
posted @ 2021-11-16 14:06 林木森3 阅读(89) 评论(0) 推荐(0)
摘要: Python有很多的学习方向,比如说数据采集方向(爬虫),或者Web开发方向,也可能是最近特别火热的人工智能方向。每个方向所需要的技术都是不尽相同的,所以在我们学习完成Python的基础语法之后,一定要慎重选择自己之后的进阶方向。 就像学习其他编程语言或者是学习一门外语一样 ,我们应该从Python 阅读全文
posted @ 2021-09-06 22:02 林木森3 阅读(114) 评论(0) 推荐(0)
摘要: print(''' * * * * * * * * @ @ * * * * @ * * * * * * * * * * * * ''') 阅读全文
posted @ 2021-09-06 21:16 林木森3 阅读(51) 评论(0) 推荐(0)