Question: I have a python3 Linux command line assignment that I'd love to solve. Can you help me, please? I only have one question left on
I have a python3 Linux command line assignment that I'd love to solve. Can you help me, please? I only have one question left on here, so I'm asking you please to answer them all; really need your help. Thanks so much! (I am not sure what the csv module is, but as long as the python3 code works in the Linux command line, it should be fine. Would the open() file method work here?). I'd really appreciate it if you'd answer all my questions. Thanks a lot!
1) Consider the following list of student grades. Write a script that will open the file and calculate the average for each student and the grade that the student would receive based on the grade scale for this course found in the syllabus. It should save the output to a file named out604.txt
| Input file (lab0604.csv) | Expected output file (out604.txt) |
| name,hw1,h2,h3,lb1,lb2,lb3,ec,fn Andrew,69,52,32,83,22,33,77,34 Brandon,87,80,79,85,99,92,77,80 Chelsey,98,97,91,92,93,99,91,94 Deborah,51,61,28,58,34,53,74,39 Erik,80,88,97,88,102,106,86,94 Arielle,73,73,88,79,73,80,90,82 Shaun,61,76,77,69,71,80,74,67 Ninette,88,67,28,42,51,66,57,43 Nguyen,5,23,93,60,31,25,65,23 | Name grade letter Andrew 50.25 E Brandon 84.88 B Chelsey 94.38 A Deborah 49.75 E Erik 92.62 A- Arielle 79.75 C+ Shaun 71.88 C- Ninette 55.25 E Nguyen 40.62 E |
Here is the course' grading scale:
Grading Scale
| Percent Grade | Letter |
| > 97% | A+ |
| 94% to 96% | A |
| 90% to 93% | A- |
| 87% to 89% | B+ |
| 84% to 86% | B |
| 80% to 83% | B- |
| 76% to 79% | C+ |
| 70% to 75% | C |
| 60% to 69% | D |
| < 60% | E |
2) Write a Python script that will take in a name and return the respective address based on a csv file of names and addresses. If the name is not found in the file, prompt the user to enter an address for that name and add it to the file.
| Input | Expected output |
| Todd Frankie Homer Add address: 742 Evergreen Terrace Homer | Todd: 344 South Fairview Frankie: 1123 Wilson Way No address found for Homer Homer: 742 Evergreen Terrace |
3) Oh no! The nefarious Doctor Doom is planning on hacking into the satellite broadcasting system to spread his maniacal message of misdoing across the planet. We need to make sure that he cant get his way! Use what you learned in this section about Python in order to create some sort of super secret security script that will let the technicians access the system but keep that diabolical delinquent Doom locked out!
Your script should take in a four digit code, check each of the digits, and then, assuming they are all correct, grant access to the system. If only some of the digits are correct, the script should output how many of the digits are correct, just in case the technicians have forgotten some of the code. With your help, Doom doesnt stand a chance!
| Input string | Expected output of script |
| Enter code: 8756 Enter code: 4752 Enter code: 3942 Enter code: 5962 Enter code: 1962 | 0 digits correct 1 digits correct 2 digits correct 3 digits correct Access granted! |
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
