A random dataset

Report a typo

Please note: for now, when you go to the tab IDE, you can solve this problem only via Pycharm. We are sorry for the inconvenience, we will fix this as soon as we can. If you prefer to solve the problem via a different IDE, you should open it manually and then copy the solution to the website.

It's high time for you to work with your own dataset!

In the dataset, you can find results of an English test taken by the students of an American school. The results are points from 0 to 100. Read all the integers from the data and find their arithmetic mean. In the output, print the sum of the found arithmetic mean and the last integer in the dataset.

Below is an example beginning of your code. It reads the integers from the file and adds them to the list. Of course, you can use other ways of making a list.

filename = 'the name of the file goes here.txt'
f = open(filename)
lst = f.read().split()  # now it contains points as strings
f.close()

new_list = []  # create an empty list for adding integers
for i in lst:
    new_list.append(int(i)) # transform a string representation into an integer and append it
Write code in your IDE to process the text file and display the results below
___

Create a free account to access the full topic