其他分享
首页 > 其他分享> > 123213124

123213124

作者:互联网

  1. import math
  2. import os
  3. from os import path
  4. import numpy as np
  5. filePath = input("Please enter the file path: ");
  6. while not path.exists(filePath):
  7. filePath = input("File path error, please re-enter: ");
  8. if path.exists(filePath):
  9. break
  10. file_object = open(filePath,“r”).readlines()
  11. rainfall=[]
  12. for line in file_object()[5:]:
  13. for i in range:
  14. if file_object(i)>0.1:
  15. rainfall.append(file_object(i))
  16. b=np.sum(rainfall)
  17. print (b)

import math
import os
from os import path
import numpy as np
filePath = input("Please enter the file path: ");
while not path.exists(filePath):
filePath = input("File path error, please re-enter: ");
if path.exists(filePath):
break
file_object = open(filePath,“r”).readlines()
rainfall=[]
for line in file_object()[5:]:
for i in range:
if file_object(i)>0.1:
rainfall.append(file_object(i))
b=np.sum(rainfall)
print (b)

标签:rainfall,filePath,object,file,import,path,123213124
来源: https://blog.csdn.net/Wanna_up/article/details/88622995