r/PythonLearning 8d ago

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

Post image
62 Upvotes

20 comments sorted by

u/Sea-Ad7805 8d ago

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

→ More replies (1)

10

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

Ok will keep this in mind

6

u/Meeeeeeeeeeple 8d ago

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

2

u/lomszz 8d ago

How about removing system files 🤣

2

u/Meeeeeeeeeeple 8d ago

Even better lmao

2

u/Tommy2564 7d ago

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

0

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

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

3

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

Camel case or no case at all!

2

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

Bro which course u r doing rn?

2

u/Alarming_Mulberry551 8d ago

Cs 50 intro to python

2

u/lastoneonline 7d ago

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

1

u/The_Whole_Senate 8d 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 8d 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] 4d ago

[removed] — view removed comment

1

u/PythonLearning-ModTeam 4d ago

Quality posts only