马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
本帖最后由 一个账号 于 2020-3-7 19:39 编辑 def qiuhe(*params):
s = 0
while True:
if params[len(params)-1] == 5:
#params.pop()
for i in params:
s+=i
return (s-5)*5
else:
for m in params:
s+=m
return s*3
print(qiuhe(1,2,8,5,4,5))
print(qiuhe(1,2,8,5,4))
def shui():
for i in range(100,1000):
x = i%10 # temp = i
t = i//10 # sum = 0
y = t%10 # while temp:
t = t//10 # sum = sum +(temp%10)**3
if x**3+y**3+t**3 ==i: # temp = temp//10
print(i) # if sum == i:
shui()
def finstr(x,y):
m = len(x)
n=0
a=0
while n<m-1:
if x[n] == y[0] and x[n+1] == y[1]:
a +=1
n += 1
return a
print(finstr('you cannot improve your past but you can improve your future im','im'))
|