Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- open("planets.txt").read().splitlines()
- open("planets.txt").read().splitlines()
- [x for x in lines if x != '']
- open("numbers.txt").read().splitlines()
- [float(x) for x in lines if x != '']
- (sum(numbers)/len(numbers))
- John,66.3,170.2
- Jane,54.1,162.8
- Jimmy,89.5,179.8
- ['John',66.3,170.2],
- ['Jane',54.1,162.8],
- ['Jimmy',89.5,179.8]
- file = input("Enter score file: ")
- data = open(file).read().splitlines()
- numbers = [float(x) for x in data if x != ""]
- AVG = sum(numbers)/len(numbers)
- MAX = max(numbers)
- MIN = min(numbers)
- for i in range(len(numbers)):
- print(f"Student #{i+1} score: {numbers[i]:.0f}")
- print(f"Average score is {AVG:.2f}")
- print(f"Minimum score is {MIN:.0f}")
- print(f"Maximum score is {MAX:.0f}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement