Here there is already a similar question, but I need a solution that does not involve connecting the csv module. File to read:
Петров;85;92 Сидоров;100;88 Иванов;58;72 It is required to display the average value of the first and second pairs of values under each name. I try to do it like this:
file = open('In.txt', 'r') for line in file: [print((first + second)/2) for name, first, second in line.split(';')] But this design does not work. How to divide a string, obtained in a loop from a file by a symbol ; ?