2023年3月8日软工日报

今天上午的课太没意思了,很困,不如建民的课,建民的课起码不会困。今天下午开了个班会,然后自学了会儿python,今天的代码量就150行,晚上没干啥,跑了步,累了个够呛。

今天写了的python作业:

 

 

1 money=input()
2 if money[0] in ['R']:
3     U=eval(money[1:])/6
4     print("${:.2f}".format(U))
5 elif money[0] in ['$']:
6     R=6*eval(money[1:])
7     print("R{:.2f}".format(R))

 

 

 1 a = int(input())
 2 if a >= 90:
 3     print("A")
 4 elif a < 90 and a >= 80:
 5     print("B")
 6 elif a < 80 and a >= 70:
 7     print("C")
 8 elif a < 70 and a >= 60:
 9     print("D")
10 else:
11     print("E")

 

 

 1 def jc(n):
 2     s = 1
 3     for i in range(1,n+1):
 4         s*=i
 5     return s
 6  
 7 def funcos(eps,x):
 8     s,sgn,i=0,1,0
 9     err = sgn*(x**i)/jc(i)
10     while abs(err) > eps or abs(err) == eps :#精确到最后一项的绝对值小于eps(绝对值小于eps的项不要加):
11         s += err
12         sgn = -sgn
13         i = i + 2
14         err = sgn*(x**i)/jc(i)
15     return s

 

posted @ 2023-03-08 21:22  阿飞藏泪  阅读(10)  评论(0编辑  收藏  举报
1 2 3
4