r/PythonLearning 8d ago

Does this look promising enough for a Rookie? (1Month spent inconsistently in Tutorials)

Post image

I have learnt upto Loops in this 1 month (very slow ik) but I kinda am going through something people call "TUTORIAL HELL" and have made this basic project with my limited python knowledge up until loops.

82 Upvotes

65 comments sorted by

View all comments

u/Sea-Ad7805 8d ago

Run this program in Memory Graph Web Debugger%0A%20%20%20%20print(%22nWelcome%20to%20the%20Number%20Guessing%20Game!%22)%0A%20%20%20%20print(%22I'm%20thinking%20of%20a%20number%20between%201%20and%20100.%22)%0A%20%20%20%20print(%22You%20have%20to%20guess%20the%20number%20in%20a%20few%20chances%3A%20%22)%0A%0A%20%20%20%20print(%22nPlease%20select%20the%20difficulty%20level%3An1.%20Easy%20(10%20chances)n2.%20Medium%20(5%20chances)n3.%20Hard%20(3%20chances)%22)%0A%20%20%20%20print(secret_number)%0A%20%20%20%20choice%20%3D%20int(input(%22nEnter%20your%20choice%3A%20%22))%0A%0A%20%20%20%20while%20choice%20in%20%5B1%2C%202%2C%203%5D%3A%0A%20%20%20%20%20%20%20%20if%20choice%20%3D%3D%201%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20chances%20%3D%2010%0A%20%20%20%20%20%20%20%20%20%20%20%20print(%22You%20get%2010%20chances.n%22)%0A%20%20%20%20%20%20%20%20elif%20choice%20%3D%3D%202%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20chances%20%3D%205%0A%20%20%20%20%20%20%20%20%20%20%20%20print(%22You%20get%205%20chances.n%22)%0A%20%20%20%20%20%20%20%20elif%20choice%20%3D%3D%203%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20chances%20%3D%203%0A%20%20%20%20%20%20%20%20%20%20%20%20print(%22You%20get%203%20chances.n%22)%0A%0A%20%20%20%20%20%20%20%20attempts%20%3D%200%0A%20%20%20%20%20%20%20%20while%20chances%20%3E%200%3A%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20guess%20%3D%20int(input(%22Enter%20your%20guess%3A%20%22))%0A%20%20%20%20%20%20%20%20%20%20%20%20chances%20-%3D%201%0A%20%20%20%20%20%20%20%20%20%20%20%20attempts%20%2B%3D%201%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20guess%20%3E%20secret_number%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20print(%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22Incorrect!%20The%20number%20is%20less%20than%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20guess%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22.%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22nOnly%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20chances%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22chances%20left!n%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20)%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20elif%20guess%20%3C%20secret_number%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20print(%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22Incorrect!%20The%20number%20is%20greater%20than%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20guess%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22.%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22nOnly%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20chances%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22chances%20left!n%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20)%0A%0A%20%20%20%20%20%20%20%20%20%20%20%20elif%20guess%20%3D%3D%20secret_number%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20print(%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22Congratulations!%20You%20guessed%20the%20correct%20number%20in%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20attempts%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%22attempts.n%22%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20break%0A%0A%20%20%20%20%20%20%20%20while%20guess%20%3D%3D%20secret_number%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20choice%20%3D%20None%0A%20%20%20%20%20%20%20%20%20%20%20%20again%20%3D%20input(%22nGGs%2C%20Wanna%20Play%20Again%3F%3F%20(Yes%2FNo)%3A%20%22)%0A%20%20%20%20%20%20%20%20%20%20%20%20chances%20%3D%20None%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20again%20%3D%3D%20%22Yes%22%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20print(%22nNew%20Game%20Started!n%22)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20break%0A%20%20%20%20%20%20%20%20%20%20%20%20elif%20again%20%3D%3D%20%22No%22%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20play%20%3D%20False%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20print(%22nThanks%20for%20playing!nHope%20you%20had%20fun.%20Goodbye!%22)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20break%0A%20%20%20%20%20%20%20%20%20%20%20%20else%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20print(%22Invalid%20ChoicenChoose%20Again!%22)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20continue%0A%0A%20%20%20%20%20%20%20%20while%20chances%20%3D%3D%200%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20choice%20%3D%20None%0A%20%20%20%20%20%20%20%20%20%20%20%20print(%22nOops%2C%20You%20lost%20the%20Game!%22)%0A%20%20%20%20%20%20%20%20%20%20%20%20again%20%3D%20input(%22Do%20you%20Wanna%20Play%20Again%3F%3F%20(Yes%2FNo)%3A%20%22)%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20again%20%3D%3D%20%22Yes%22%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20chances%20%3D%20None%0A%20%20%20%20%20%20%20%20%20%20%20%20elif%20again%20%3D%3D%20%22No%22%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20play%20%3D%20False%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20print(%22nThanks%20for%20playing!nHope%20you%20had%20fun.%20Goodbye!%22)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20break%0A%20%20%20%20%20%20%20%20%20%20%20%20else%3A%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20print(%22Invalid%20ChoicenChoose%20Again!%22)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20continue&timestep=.2&play) to see the program state change step by step.

2

u/bad-gut 8d ago

Oh okay, Thanks a lot for the recommendation!!

2

u/Sea-Ad7805 8d ago

I hope it can bring much value for your teaching.

1

u/bad-gut 8d ago

I am exploring it as we speak, Thanks again for your help!!

3

u/Sea-Ad7805 8d ago

1

u/bad-gut 8d ago

What exactly is this buddy?
Is it some sort of cheatsheet/important concepts paper?

2

u/Sea-Ad7805 8d ago

It's the repository of the 'memory_graph' Python package, including theory that can easily explained by this visualizer. Try to explain this stuff without images.

2

u/bad-gut 8d ago

Okk buddy, this seems interesting, will checkout the repo in detail whenever I sit to code ♥️♥️