随笔分类 - Python123第四周作业
摘要: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")
阅读全文
摘要: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(),
阅读全文
摘要:s = "qS2x" N = input() if s.lower() == N.lower(): print("验证码正确") else: print("验证码错误,请重新输入")
阅读全文
摘要:a = input() b = input() c = b.rfind(a) if c 1: print("Not Found") else: print("index = {:d}".format(c))
阅读全文
摘要:words = ("垃圾","陷阱","不要脸","内幕","辣鸡") text = input() for word in words: if word in text: text = text.replace(word, "*") print(text)
阅读全文
摘要: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
阅读全文
摘要:str1=input() str2=input() a=input() b=a.replace(str1,str2) print(b)
阅读全文
摘要: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
阅读全文
摘要: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}
阅读全文
浙公网安备 33010602011771号