摘要:
"""快乐的数字""" def getSumofSquares(num): numStr=str(num) sum=0 digitls=[int(x) for x in numStr] for i in digitls: sum += i**2 return sum def main(): n = 阅读全文
posted @ 2021-09-13 22:18
苒若
阅读(53)
评论(0)
推荐(0)
摘要:
"""凯撒密码""" s = input("") t = "" for c in s: if 'a' <= c <= 'z': t += chr( ord('a') + ((ord(c)-ord('a')) + 3 )%26 ) elif 'A'<=c<='Z': t += chr( ord('A' 阅读全文
posted @ 2021-09-13 22:13
苒若
阅读(21)
评论(0)
推荐(0)
摘要:
"""同符号数学运算""" a = int(input())A = abs(a)b = A+10c = A-10d = A*10if a < 0: b = -abs(b) c = -abs(c) d = -abs(d)else: b = abs(b) c = abs(c) d = abs(d)pri 阅读全文
posted @ 2021-09-13 19:42
苒若
阅读(61)
评论(0)
推荐(0)
摘要:
"""天天向上的力量 B""" N = eval(input()) energy_1 = pow(1+N/1000,365) energy_2 = pow(1-N/1000,365) p = int(energy_1/energy_2) print("{:.2f}, {:.2f}, {:}".for 阅读全文
posted @ 2021-09-13 01:13
苒若
阅读(42)
评论(0)
推荐(0)
摘要:
"""照猫画虎求阶乘""" n = int(input()) j = 1 for i in range(1,n+1): j = j * i print(j) 学号:2020310143012 昵称:苒若 阅读全文
posted @ 2021-09-13 00:45
苒若
阅读(53)
评论(0)
推荐(0)
摘要:
"""字符串逆序输出""" string = input() print(string[::-1]) 学号:2020310143012 昵称:苒若 阅读全文
posted @ 2021-09-13 00:22
苒若
阅读(66)
评论(0)
推荐(0)
摘要:
"""格式化输出""" a = float(input()) print('{:.3f}'.format(a)) 阅读全文
posted @ 2021-09-13 00:11
苒若
阅读(16)
评论(0)
推荐(0)