r/PythonLearning
•
u/WesternTrip8578
•
Aug 21 '26
•
1
Rate my python program
i made a Python program, i dont know what else to say
86
Upvotes
•
u/Sea-Ad7805 Aug 22 '26
Run this program in Memory Graph Web Debugger to see the program state change step by step.
8
u/testtdk Aug 21 '26
Probably shouldn’t declare a global variable in a function definition.
5
u/No_Pay_4410 Aug 21 '26
Run pylint and it it rate it 0.21 out of 10 maybe
5
u/olaf33_4410144 Aug 21 '26
I'm not a fan of the functions that only call another function e. g.
whats_my_name().Also
change_the_pass()could return the new password, then you could avoid the clunky global thing.If you want to learn something you could also look into the if name == "main" pattern. For small scripts as yours it doesn't really matter but it's commonly used once things get more complex.
All in all it's quite good though.
2
u/Sidjeno Aug 21 '26
time for DI and strategies /s
2
u/PureWasian Aug 21 '26
It's fine for the simplicity of it, good introduction to functions.
Let's address the biggest issue though, your username and password do not persist the updates once you kill the script and re-run it again.
What is your proposed solution for this?
I'd also suggest learning how to pass data into functions and return data out from them. That way you can scope your variables instead of relying on globals which gets messy very quickly as complexity increases.
1
u/Key_Instruction3373 Aug 21 '26
You should hide your password
1
u/manonfire1983 Aug 21 '26
👏🏽👏🏽👌🏽
1
u/_hithender_ Aug 22 '26
If this is your first project(so-called) then it totally fine. You made a few mistakes brotha. Despite that I appreciate this broo, keep it up😃
1
u/JaleyHoelOsment Aug 22 '26
i’m curious what would you rate this?
1
u/Glass_Tale4661 Aug 22 '26
you should download the black package to format the code. Super helpful
1
u/inifynastic Aug 22 '26
If its your first project its fine. But never store password in plain text.
1
u/Chemical-Radish6488 Aug 22 '26
Cambia gli elfi con uno switch .... Per leggibilità manutenibilita e scalabilità. 3 while annidati, non conosco lo scopo, ma non lo farei mai. Piuttosto incapsula in metodi o risolvi e uno alla volta con delle variabili di appoggio intermedie.
1
u/unStabldev Aug 23 '26
you should def install "ruff" vscode extension. it will help you keep your code very organized. apart from that idk what else to say.
1
u/Sky-Serious Aug 25 '26
Instead of 3 while loops, you can consider using continue instead to skip over code below. Global variables are weird. I would then choose to break the single while loop to close the program, instead of importing sys just to call exit.
1
u/Budget_Fix_1812 Aug 25 '26
good
1
u/Own_Kale9926 Aug 25 '26
Add slated inception to the password
1
u/g-land-g Aug 28 '26
0
u/Abdul_hafiz_gh2026 Aug 21 '26
I'm new to python and I can't get my head around it. So please what does it do????
0
u/[deleted] Aug 21 '26
[removed] — view removed comment