Python help need
- or -
Post a project like this2915
$$
- Posted:
- Proposals: 7
- Remote
- #1120879
- Awarded
Description
Experience Level: Intermediate
General information for the business: Python code help need
Description of requirements/functionality: Need help in this code
with open("class1.txt") as f:
## lines = f.readlines()
## lines = sorted(lines)
## for line in lines:
## name = line[:line.find(",")]
## marks = line[line.find(",")+1:].split(",")
## marks = sorted(marks)
## print(name + "'s Score = " + marks[-1])
##
##
d = {}
for line in f:
column = line.split(":")
names = column[0]
scores = int(column[2].strip())
count = 0
while count < 3:
d.setdefault(names, []).append(scores)
count = count + 1
##print(d)
##averages=[]
for names, v in sorted(d.items()):
average = (sum(v)/len(v))
print(names,average)
averages=[]
averages.append(average)
OS requirements: Windows
Extra notes:
Description of requirements/functionality: Need help in this code
with open("class1.txt") as f:
## lines = f.readlines()
## lines = sorted(lines)
## for line in lines:
## name = line[:line.find(",")]
## marks = line[line.find(",")+1:].split(",")
## marks = sorted(marks)
## print(name + "'s Score = " + marks[-1])
##
##
d = {}
for line in f:
column = line.split(":")
names = column[0]
scores = int(column[2].strip())
count = 0
while count < 3:
d.setdefault(names, []).append(scores)
count = count + 1
##print(d)
##averages=[]
for names, v in sorted(d.items()):
average = (sum(v)/len(v))
print(names,average)
averages=[]
averages.append(average)
OS requirements: Windows
Extra notes:
Abdul Q.
99% (16)Projects Completed
8
Freelancers worked with
8
Projects awarded
28%
Last project
16 Nov 2018
United Kingdom
New Proposal
Login to your account and send a proposal now to get this project.
Log inClarification Board Ask a Question
-
There are no clarification messages.
We collect cookies to enable the proper functioning and security of our website, and to enhance your experience. By clicking on 'Accept All Cookies', you consent to the use of these cookies. You can change your 'Cookies Settings' at any time. For more information, please read ourCookie Policy
Cookie Settings
Accept All Cookies