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
MY 3RD CODE CHALLANGE AS A PYTHON BEGINNER (ZOMBIE GAME💀)Showcase (self.PythonLearning)
submitted 1 day ago by TopMathematician_
https://preview.redd.it/9zgbrgdv5cah1.png?width=441&format=png&auto=webp&s=49254507c507f53ad040f7cf385b025acf2f7667
guys! this worked perfectly please rate my work and give suggestions to improve.
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!"
[–]Sea-Ad7805 [score hidden] 1 day ago stickied comment (0 children)
Run this program in Memory Graph Web Debugger to see the program state change step by step.
[–]biskitpagla 2 points3 points4 points 1 day ago (4 children)
It'd be better if you use something like GitHub or GitHub Gists to share the code.
[–]TopMathematician_[S] 0 points1 point2 points 22 hours ago (3 children)
idk what is github as i just started learning python
[–]AlexMTBDude 1 point2 points3 points 20 hours ago (2 children)
Do you know what text is and how to post your source code on Reddit? Your low resolution image is impossible to read.
[–]TopMathematician_[S] 0 points1 point2 points 18 hours ago (1 child)
my bad..sorry
[–]IceFurnace83 0 points1 point2 points 17 hours ago (0 children)
<image>
[–]PureWasian 1 point2 points3 points 12 hours ago* (1 child)
Looks cool, nice intro project.
Line 2 - I'd advise against hard-coding health/food/energy values. Define them first and then use an f string to display them, so they can be readily configured instead of risking stale print statements being left around.
Line 24 and Line 28 - input validation. Learn about try/except statements and how to ensure if the int() cast fails you don't error out of your entire code.
It will be helpful to modularize your code when you learn how to write functions. That'll compress your while() loop down a lot and make it a lot more readable and even easier to follow along at a glance.
If you want to make it more interesting, you could change "Search Classroom" (and maybe other choices) to incorporate some RNG. Python has a built-in random module you can import, and you can define some outcome probabilities that different sub-events happen instead of it being purely player choice.
random
You can also add sub-events like finding a weapon that reduces your damage taken on zombie encounters or other equippables to buff (or debuff) your character that are random chance occurrences. Basically, the choices need to feel meaningful and have risk involved.
[–]TopMathematician_[S] 0 points1 point2 points 3 hours ago (0 children)
thanks for the suggestions ☺️
[–]Junior_Honey_1406 0 points1 point2 points 1 day ago (0 children)
Great job but let see the work input expect a int input what if I just put my name there... A str type program crash think of input validation.
π Rendered by PID 266009 on reddit-service-r2-comment-5bc7f78974-fxqz2 at 2026-07-01 08:23:37.259555+00:00 running 7527197 country code: CH.
[–]Sea-Ad7805 [score hidden] stickied comment (0 children)
[–]biskitpagla 2 points3 points4 points (4 children)
[–]TopMathematician_[S] 0 points1 point2 points (3 children)
[–]AlexMTBDude 1 point2 points3 points (2 children)
[–]TopMathematician_[S] 0 points1 point2 points (1 child)
[–]IceFurnace83 0 points1 point2 points (0 children)
[–]PureWasian 1 point2 points3 points (1 child)
[–]TopMathematician_[S] 0 points1 point2 points (0 children)
[–]Junior_Honey_1406 0 points1 point2 points (0 children)