Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- searchfile = open("C:usersmmb0368Documentsinput.txt", "r")
- file_content = searchfile.read()
- print (file_content)
- connectionList = []
- for line in file_content:
- lineList = (line.strip()).split()
- connectionList.append(lineList)
- end = 0
- x_min = None
- x_max = None
- for x in connectionList:
- conns = int(x[0])
- end += conns
- if x_min is None or conns < x_min:
- x_min = conns
- if x_max is None or conns > x_max:
- x_max = conns
- mean = end /len(connectionList)
- print('Mean Value:',mean)
- print('Max:', x_max)
- print('Min:', x_min)
- searchfile.close()
Add Comment
Please, Sign In to add comment