2
u/Loud-Bake-2740 Sep 19 '25
nice job! as others have said there’s some error handling to be had but overall this works. A good extension challenge for this would be to see how you’d track / input grades for multiple students :) happy hunting!
1
2
2
u/Top-Run-21 Sep 22 '25
got to learn from this, btw why did you defined a funcion for all this? for practice?
1
2
u/P1nkUnicorn7 Sep 23 '25
Looks good! I would also recommend using a formatting specification in the print of the average, to show 2-3 decimal points accuracy instead of 17.
print(f"Average grade: {average_grades:.2f}") I suppose that is up to personal preference, I just think it's nicer.
1
1
u/ConnectionWorking207 Sep 19 '25
What book are you using to learn?
1
u/fatimalizade Sep 19 '25
I don’t use any book
1
1
2
2
u/ConsiderationLow762 Sep 20 '25
Great practice. Also there is a better way that you can get number of grades dynamically rather than asking manually, using the built in length.
1
u/Inevitable-Age-06 Sep 20 '25
I also want to start python can we do it together? I know some basics till conditional statement.
3
3
Sep 19 '25
[removed] — view removed comment
2
1
u/FoolsSeldom Sep 19 '25
I think "always" is a bit strong. Input validation is important, but
try/acceptis not the only option.For example, the
str.isdecimalmethod is good for checking for a valid integer string.


2
u/TfGuy44 Sep 19 '25
Oh, but I wanted to enter 0 grades... uh oh!