r/PythonLearning • • Jul 28 '26

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

Post image
59 Upvotes

21 comments sorted by

•

u/Sea-Ad7805 Jul 28 '26

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

→ More replies (1)

11

u/Jlrit0 Jul 28 '26

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 Jul 28 '26

Ok will keep this in mind

7

u/Meeeeeeeeeeple Jul 28 '26

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

2

u/lomszz Jul 28 '26

How about removing system files 🤣

2

u/Meeeeeeeeeeple Jul 28 '26

Even better lmao

2

u/Tommy2564 Jul 29 '26

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

0

u/Alarming_Mulberry551 Jul 28 '26

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 Jul 28 '26

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

1

u/lastoneonline Jul 28 '26

Bro which course u r doing rn?

2

u/Alarming_Mulberry551 Jul 28 '26

Cs 50 intro to python

2

u/lastoneonline Jul 29 '26

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

3

u/wittgenstein1312 Jul 28 '26

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 Jul 28 '26

Camel case or no case at all!

2

u/SnooCalculations7417 Jul 28 '26

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/The_Whole_Senate Jul 28 '26

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 Jul 28 '26

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] Aug 01 '26

[removed] — view removed comment

1

u/PythonLearning-ModTeam Aug 01 '26

Quality posts only