Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started