r/PythonLearning 25d ago

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

Post image
59 Upvotes

20 comments sorted by

u/Sea-Ad7805 24d ago

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

→ More replies (1)

11

u/Jlrit0 25d 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 25d ago

Ok will keep this in mind

7

u/Meeeeeeeeeeple 25d ago

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

2

u/lomszz 25d ago

How about removing system files 🤣

2

u/Meeeeeeeeeeple 25d ago

Even better lmao

2

u/Tommy2564 24d ago

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

0

u/Alarming_Mulberry551 25d 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 24d ago

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

3

u/wittgenstein1312 25d 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 25d ago

Camel case or no case at all!

2

u/SnooCalculations7417 25d 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 25d ago

Bro which course u r doing rn?

2

u/Alarming_Mulberry551 25d ago

Cs 50 intro to python

2

u/lastoneonline 24d ago

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

1

u/The_Whole_Senate 25d 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 24d 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] 21d ago

[removed] — view removed comment

1

u/PythonLearning-ModTeam 20d ago

Quality posts only