写入txt文件

xiaoxiao2021-02-28  65

# -*- coding: UTF-8 -*- import random num=[]; i=2

#for i in range(2,100000) ,这100000可以更大~!!

#for i in range(2,100000) ,2也是可变的。

f = open("sss.txt","w") for i in range(509989,510000):    j=2    for j in range(2,i):       if(i%j==0):          break    else:

      num.append(i)

#关键是,file = f !!!!!!!!!!!!!!!!!

print(num,file = f)
转载请注明原文地址: https://www.6miu.com/read-2600230.html

最新回复(0)