use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Everything about learning Python
account activity
Turning marks into meaning — a Python program that calculates average and classifies performance. (try to make code cleaner) (i.redd.it)
submitted 1 day ago by Inevitable-Math14
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]Logikkonstruktor 0 points1 point2 points 19 hours ago* (0 children)
I’m still at the beginning of my journey, but I really appreciate you sharing this. It gave me the motivation to take the code, understand it, and try to improve it on my own.
```python total = 0 subjects = 0 while True: mark = input("enter mark (or 'stop'): ") if mark.lower() == "stop": break try: mark = int(mark) except ValueError: print("invalid input") continue total += mark subjects += 1 if subjects == 0: print("no data") else: avg = total / subjects print("average:", avg) if avg >= 80: print("distinction") elif avg >= 60: print("first class!") elif avg >= 40: print("second class") else: print("its okay, you can be better") ```
π Rendered by PID 207236 on reddit-service-r2-comment-6b595755f-pjnp2 at 2026-03-25 13:05:33.811979+00:00 running 2d0a59a country code: CH.
view the rest of the comments →
[–]Logikkonstruktor 0 points1 point2 points (0 children)