Question: I am trying to complete this assignment. I am not able to get PyCharm to show my output . txt file. What can I do
I am trying to complete this assignment. I am not able to get PyCharm to show my output txt file. What can I do to fix this?
import datetime
def findGradetestavrg:
grade
if testavrg :
grade A
elif testavrg :
grade B
elif testavrg :
grade C
elif testavrg :
grade D
elif testavrg :
grade F
return grade
# program will start from main function
if namemain:
studentdatadict dict
now datetime.datetime.now
currentdatetime now.strftimemdY H:M:S
college "Chattahoochee Technical College"
term "Fall
instructor Dr Jerry Mamo"
isMoreDataToEnter True
while isMoreDataToEnter:
studenttempdict dict
studentId intinputEnter the student Id :
if studentId :
printPlease enter valid student Id Try again!
continue
firstname inputEnter first name :
lastname inputEnter last name :
test intinputEnter Test number :
test intinputEnter Test number :
test intinputEnter Test number :
testaverage test test test
testaverage roundtestaverage,
grade findGradetestaverage
studenttempdictFirst Name" firstname
studenttempdictLast Name" lastname
studenttempdictTest test
studenttempdictTest test
studenttempdictTest test
studenttempdictTest Average" testaverage
studenttempdictGrade grade
studentdatadictstudentId studenttempdict
flag inputDo you want enter more record Y or N
if flag.lowern:
isMoreDataToEnter False
with openstudentdata.txtw as out:
out.writeCollege: college
out.writeTerm: term
out.writeInstructor: instructor
out.writeDate: strcurrentdatetime
for studentid, idDict in studentdatadict.items:
out.writeStudent Id: strstudentid
for key, value in idDict.items:
out.writekey : strvalue
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
