Limited Offer Get 25% off — use code BESTW25
No AI No Plagiarism On-Time Delivery Free Revisions
Claim Now
Prices start at $5 per page · plagiarism-free papers · free revisions for 14 days 24/7 support: support@bestwriters.com
Uncategorized

Write a Python code that gets a file name from a user

  • Posted
  • Authoradmin
  • Length205 words
  • Reading time1 min
Write My Assignment FREE

Write a Python code that gets a file name from a user using the input
statement and reads it to obtain information about students. Each line of the file
includes information about a different student and has two items separated by a
space character. A file, grades.dat, that includes the names and grades of 10
students as shown below is given as an example. The first item is the student name
and the second item is the grade of that student. The code will read the information
in the file in a dictionary where student names are keys and their grades are values
using a for loop. The second item in each line that represents a grade will be
converted to float when it is read as a value in the dictionary. The code is expected
to print the name and grade of the student that are read in each execution of the
for loop. A grade is considered success if it is 70 or above, and failure if it is below
70. The code will count the number of successes, numSuccesses, and the number
of failures, numFailures. It will print successFailureRatio, which is numSuccesses
divided by numFailures

The post Write a Python code that gets a file name from a user appeared first on My Assignment Online.

Plagiarism Free Assignment Help

Expert Help With This Assignment — On Your Terms

✓ Native UK, USA & Australia writers ✓ Deadline from 3 hours ✓ 100% Plagiarism-Free — Turnitin included ✓ Unlimited free revisions ✓ Free to submit — compare quotes

admin

Academic writer and editor at BestWriters.

Get your paper off your plate tonight

Post your instructions for free. Prices start at $5 per page.

Place an order