Guest User

Untitled

a guest
Jan 17th, 2019
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. searchfile = open("C:usersmmb0368Documentsinput.txt", "r")
  2. file_content = searchfile.read()
  3. print (file_content)
  4.  
  5. connectionList = []
  6. for line in file_content:
  7. lineList = (line.strip()).split()
  8. connectionList.append(lineList)
  9. end = 0
  10. x_min = None
  11. x_max = None
  12. for x in connectionList:
  13. conns = int(x[0])
  14. end += conns
  15. if x_min is None or conns < x_min:
  16. x_min = conns
  17. if x_max is None or conns > x_max:
  18. x_max = conns
  19. mean = end /len(connectionList)
  20. print('Mean Value:',mean)
  21. print('Max:', x_max)
  22. print('Min:', x_min)
  23.  
  24. searchfile.close()
Add Comment
Please, Sign In to add comment