cnt = ans =0
start =1
a =[]while cnt<100:
ans+=start
start +=1
t = ans+start
cnt+=1
a.append(ans)print(sum(a))
2.奖券数目
代码
deff(x)->bool:while x:if x%10==4:returnFalse
x//=10returnTrue
ans =0for i inrange(10000,100000):if f(i):
ans+=1print(ans)
3.网友年龄
代码
deff(x):returnint(str(x)[::-1])
ans=0for i inrange(10,100):if f(i)==i-27:
ans+=1print(ans)
4.方程整数解
代码
for i inrange(1,33):for j inrange(i,33):for k inrange(j,33):if i*i+j*j+k*k==1000andmin(i,j,k)!=6:print(min(i,j,k))
5.回家路费
代码
i = cnt =1
t =2while i <108:
i += t
t +=2
cnt+=1print(cnt)
6. 质数
代码
deff(x)->bool:for i inrange(2,x//2+1):if x%i==0:returnFalsereturnTrue
ans=[2]for i inrange(3,20000):if f(i):
ans.append(i)iflen(ans)==2019:breakprint(ans[-1])
7.猜年龄
代码
ans=[]for i inrange(1,30):for j inrange(i,30):if i*j//(i+j)==6and j-i<=8:
ans.append(i)print(ans[0])
想折腾bert的同学,应该也遇到这个问题。
一、报错信息分析
完整报错信息:OSError: We couldnt connect to https://huggingface.co to load this file, couldnt find it in the cached files and it looks like google/mt5-small is not the path to a…