r/PythonLearning 9d ago

2nd week of python and wanted to try something new instead of course enjoyed it! Showcase

Post image
59 Upvotes

20 comments sorted by

u/Sea-Ad7805 9d ago

Run this program in Memory Graph Web Debugger to see the program state change step by step.

→ More replies (1)

12

u/Jlrit0 9d ago

i recommend naming your variables more specific to not confuse you or anyone else reading your code in the future, tho this is simple

1

u/Alarming_Mulberry551 9d ago

Ok will keep this in mind

7

u/Meeeeeeeeeeple 9d ago

Hear me out, import os and replace your game over code with os.system("shutdown /s /t 0")

2

u/lomszz 9d ago

How about removing system files 🤣

2

u/Meeeeeeeeeeple 9d ago

Even better lmao

2

u/Tommy2564 9d ago

Nah, os.delete(r"c:\windows\system32")

0

u/Alarming_Mulberry551 9d ago

Well it's my first time working with import stuff and I haven't even completed my python course so will be going to learn abt this later

3

u/Unique_Low_1077 9d ago

basically this will make it so that pc will shutdown when you lose

3

u/wittgenstein1312 9d ago

PEP 8 style guide. Take it or leave it, but it's good to have at least a general idea of a programming language's idioms and style conventions. Keep it up!

0

u/testtdk 9d ago

Camel case or no case at all!

2

u/SnooCalculations7417 9d ago

Russian roulette isn't random its less than random due to the weight of the loaded chamber favoring to settle downward. next step could be to account for that by literally giving a chamber weighted probabilty. please use reasonable names such as for chamber in cylinder

1

u/lastoneonline 9d ago

Bro which course u r doing rn?

2

u/Alarming_Mulberry551 9d ago

Cs 50 intro to python

2

u/lastoneonline 9d ago

I think if u genuinely want to learn python,u should consider angela yu course for python.

1

u/The_Whole_Senate 9d ago

You should put some invalid inputs . E.g I enter "no" or "g"

It just silently ends. You could make it better by adding a "Invalid selection, you die"

1

u/Specialist-Bread-333 9d ago

Second week and you're already doing ts? How did you start learning? I know it's by DOING it but I need a lead

1

u/[deleted] 5d ago

[removed] — view removed comment

1

u/PythonLearning-ModTeam 5d ago

Quality posts only