04 2020 档案

摘要:def hano(n,x,y,z): if n==1: print(x,"-->",z) else: hano(n-1,x,z,y) print(x,"-->",z) hano(n-1,y,x,z) n = int(input("")) hano(n,"A","B","C") 阅读全文
posted @ 2020-04-14 22:31 林晓婷 阅读(146) 评论(0) 推荐(0)
摘要:import string str1 = input() for i in str1: if i in string.ascii_lowercase: print(i.upper(),end="") elif i in string.ascii_uppercase: print(i.lower(), 阅读全文
posted @ 2020-04-14 22:30 林晓婷 阅读(186) 评论(0) 推荐(0)
摘要:s = "qS2x" N = input() if s.lower() == N.lower(): print("验证码正确") else: print("验证码错误,请重新输入") 阅读全文
posted @ 2020-04-14 22:29 林晓婷 阅读(231) 评论(0) 推荐(0)
摘要:a = input() b = input() c = b.rfind(a) if c 1: print("Not Found") else: print("index = {:d}".format(c)) 阅读全文
posted @ 2020-04-14 22:27 林晓婷 阅读(265) 评论(0) 推荐(0)
摘要:words = ("垃圾","陷阱","不要脸","内幕","辣鸡") text = input() for word in words: if word in text: text = text.replace(word, "*") print(text) 阅读全文
posted @ 2020-04-14 22:26 林晓婷 阅读(218) 评论(0) 推荐(0)
摘要: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: print(-c/b) 阅读全文
posted @ 2020-04-14 22:25 林晓婷 阅读(450) 评论(0) 推荐(0)
摘要:a,b = map(int,input().split(' ')) if (a>0 and b>0 and a<b and b%2==0 and b-2*a>0): for x in range(1,a+1): y = a-x if 2*x + 4*y == b: print('{} {}'.for 阅读全文
posted @ 2020-04-14 22:23 林晓婷 阅读(225) 评论(0) 推荐(0)
摘要:ip = input() ip = ip.split('.') if len(ip) == 4: for i in range(4): if ip[i].isdigit() == False or eval(ip[i]) > 255 or eval(ip[i]) < 0: print('No') b 阅读全文
posted @ 2020-04-14 22:22 林晓婷 阅读(525) 评论(0) 推荐(0)
摘要:a = int(input()) b = int(input()) if a >= b: for i in range(1,b+1): if (a%i==0) and (b%i==0): result1 = i else: for j in range(1,a+1): if (a%j==0) and 阅读全文
posted @ 2020-04-14 22:21 林晓婷 阅读(237) 评论(0) 推荐(0)
摘要:a = int(input()) b = [] n = 1 while len(b) < a: n = n + 1 if (n>10) and (str(n) != str(n)[::-1]): for i in range(1,n): if n % i == 0: x = i else: if x 阅读全文
posted @ 2020-04-14 22:19 林晓婷 阅读(277) 评论(0) 推荐(0)
摘要:a = int(input()) b = [] n = 1 while len(b) < a: n = n+1 if str(n) == str(n)[::-1]: for i in range(1,n): if n % i == 0: x = i else: if x == 1: b.append 阅读全文
posted @ 2020-04-14 22:18 林晓婷 阅读(300) 评论(0) 推荐(0)
摘要:a = input() a = a.split(' ') b = [] for i in range(len(a)): b.append(a[i][0]) print('{}'.format(''.join(b))) 阅读全文
posted @ 2020-04-14 22:16 林晓婷 阅读(272) 评论(0) 推荐(0)
摘要:a = eval(input()) b = eval(input()) c = eval(input()) if (a % 4 == 0 and a % 100 != 0) or a % 400 == 0: mouth = [0,31,60,91,121,152,182,213,244,274,30 阅读全文
posted @ 2020-04-14 22:13 林晓婷 阅读(234) 评论(0) 推荐(0)
摘要:a = input() if 2 <= len(a) <= 3: if a[0:-1].isdigit() == True and 1<=int(a[0:-1])<=17: if a[-1] in ['a','f','A','F']: print("窗口") elif a[-1] in ['c',' 阅读全文
posted @ 2020-04-14 22:12 林晓婷 阅读(312) 评论(0) 推荐(0)
摘要:import math a = float(input()) b = float(input()) c = float(input()) if a + b > c and a + c > b and b + c > a: girth = a + b + c p = girth/2 area = ma 阅读全文
posted @ 2020-04-14 22:09 林晓婷 阅读(463) 评论(0) 推荐(0)
摘要:cock_1= 5 hen_1 = 3 chicken_1 = 1/3 a = int(100/cock_1) b = int(100/hen_1) c = int(100/chicken_1) cock = [] hen = [] chicken = [] for i in range(1,a+1 阅读全文
posted @ 2020-04-14 22:08 林晓婷 阅读(194) 评论(0) 推荐(0)
摘要:import datetime yearnow = datetime.datetime.now().year id1 = input() year = id1[6:10] mouth = id1[10:12] day = id1[12:14] gender = id1[16] if eval(gen 阅读全文
posted @ 2020-04-14 22:06 林晓婷 阅读(302) 评论(0) 推荐(0)
摘要:str1=input() str2=input() a=input() b=a.replace(str1,str2) print(b) 阅读全文
posted @ 2020-04-14 22:05 林晓婷 阅读(219) 评论(0) 推荐(0)
摘要:plaincode = input() num = int(input()) for p in plaincode: if ord("a") <= ord(p) <= ord("z"): print(chr(ord('a')+(ord(p)-ord('a')+num)%26),end='') eli 阅读全文
posted @ 2020-04-14 22:04 林晓婷 阅读(247) 评论(0) 推荐(0)
摘要:import math def distance(a,b,c): d = math.sqrt(a*a + b*b + c*c) return d x,y,z=input().split(",") d=distance(float(x),float(y),float(z)) print("{:.2f} 阅读全文
posted @ 2020-04-14 22:02 林晓婷 阅读(2082) 评论(0) 推荐(0)
摘要:import functools result = (lambda k: functools.reduce(int.__mul__, range(1, k + 1), 1))(5) print(result) 阅读全文
posted @ 2020-04-14 22:00 林晓婷 阅读(187) 评论(0) 推荐(0)
摘要:import math a,b,c = 5,8,3 x = (math.sqrt(b*b-4*a*c)-b)/(2*a) print("{}".format(x)) 阅读全文
posted @ 2020-04-14 21:59 林晓婷 阅读(161) 评论(0) 推荐(0)
摘要:def main(): a = input() sum = 0 if a.isdigit(): n = eval(a) if n > 0: fact = 1 for i in range(1, n+1): fact *= i sum += fact print(sum) else: print("输 阅读全文
posted @ 2020-04-14 21:58 林晓婷 阅读(382) 评论(0) 推荐(0)
摘要:import math num = int(input()) x = int(math.factorial(num)) print("{}".format(x)) 阅读全文
posted @ 2020-04-14 21:54 林晓婷 阅读(166) 评论(0) 推荐(0)
摘要:n=int(input("")) print(2**n) 阅读全文
posted @ 2020-04-14 21:53 林晓婷 阅读(481) 评论(0) 推荐(0)
摘要:a = float(input()) b = float(input()) if b == 0: print("除零错误") else: c =a/b y=round(c,2) print("{}".format(y)) 阅读全文
posted @ 2020-04-14 21:52 林晓婷 阅读(632) 评论(0) 推荐(0)
摘要:try: a=input() if a [-1] in ['c','C']: f=1.8*eval(a[0:-1])+32 print("{:.2f}F".format(f)) elif a [-1] in ['f','F']: c=(eval(a[0:-1])-32)/1.8 print("{:. 阅读全文
posted @ 2020-04-14 21:51 林晓婷 阅读(392) 评论(0) 推荐(0)
摘要:N=int(input()) for i in range (N): n=int(input()) if n % 2 != 0: a=i=0 elif n % 4 == 0: a = n / 2 i = n / 4 else: i = (n / 2)/4+1 a = n / 2 print ("%d 阅读全文
posted @ 2020-04-14 21:50 林晓婷 阅读(133) 评论(0) 推荐(0)
摘要:n = int(input()) list_cube = [0] for i in range(1, n + 1): list_cube.append(i * i * i) for a in range(6, n + 1): for b in range(2, a - 1): if list_cub 阅读全文
posted @ 2020-04-14 21:49 林晓婷 阅读(223) 评论(0) 推荐(0)