By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
463,119 Members | 637 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 463,119 IT Pros & Developers. It's quick & easy.

How do I get a percentage from a csv file

P: 5
How do I get a percentage from a csv file and use counting occurrences to say how many percentage was above 50?
1 Week Ago #1
Share this Question
Share on Google+
2 Replies

P: 5
count = 0
for counter in range(exams):
percentage = (exams[counter].mark/150) * 100
if percentage > 50:
count += 1 #This is an example from my program
1 Week Ago #2

P: 5
To be able to find a percentage from a CSV file you need to convert that row into an integer for e.g: percentage = int(row[i])
6 Days Ago #3

Post your reply

Sign in to post your reply or Sign up for a free account.