![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
笔记
超爱吃de小姐姐
这个作者很懒,什么都没留下…
展开
-
几点几分
s=input()N=int(s)h=5N=N+13h=(h+N/60)%24m=N%60print("%d:%d"%(h,m))原创 2021-12-20 18:31:55 · 80 阅读 · 0 评论 -
电话号码
s= input()while s != “”:if len(s) != 11 or s[0] != ‘1’ or not (s.isnumeric()) or s[1] not in [‘3’, ‘5’, ‘7’, ‘8’]:print(“NO”)else:print(“YES”)s= input()电话号码原创 2021-12-20 18:31:14 · 72 阅读 · 0 评论 -
n月后是几月
s=input()N=int(s)now=3N=(N+now)%12print("%d"%(N))N月后是几月原创 2021-12-20 18:30:29 · 162 阅读 · 0 评论 -
给定x值,求对应的y的值
''有一个函数:给定x值,输出对应的y值。’’’x=int(input())y1=xy2=2x-1y3=3x-11if x<1:print("%d"%y1)if x>=1 and x<10:print("%d"%y2)if x>=10:print("%d"%y3)原创 2021-12-20 18:29:58 · 541 阅读 · 0 评论 -
输入计算,并保存
‘’‘输入2个整数a,b输出a/b保留小数点后3位,结果为:double’’’a=int(input())b=int(input())c=a/bprint("%.3f"%c)原创 2021-12-20 18:29:08 · 62 阅读 · 0 评论 -
利用公式计算小数并保留
‘‘输入一个小数a,使用如下公式计算b的值并输出。b=cosin(a)+sin(a)小数点后保留3位小数。a,b均为double.’’’import matha=float(input())b=math.cos(a)+math.sin(a)print("%.3f"%b)原创 2021-12-20 18:28:36 · 181 阅读 · 0 评论