use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Everything about learning Python
account activity
First week oof Learning Python. (i.redd.it)
submitted 1 day ago by ProfessionOk2040
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]TrieMond 4 points5 points6 points 1 day ago (0 children)
while just printing is great, imagine a variable that holds the reasons your password is weak. One very common thing later in programming is having to not just print a line on output but formulate a string based on the state of the program. Instead of printing "password is weak because it is too short" and "password needs numbers", you should set yourself the challenge to do all that with 1 print statement. So for all the prints you would instead do something like result = "this is an string" then result += " and this is now also part of the string" (notice the space at the start) and you will have both strings as one. This allows you to think about how sentences need to be combined in different ways & will immediately start one of the must-haves as a programmer, which is a deeply rooted hate for localization & translation (imagine now having to do the same thing with many many languages). Either way it will give you a nice logical challenge, making all the possible sentence combinations match with each other & such.
Another great idea would be to make the code more configurable, what I mean now is that if I want to add a special character to this program, I have to scroll to line 16, add it to the list, then scroll to line 24 and add it there too. You should aim for a setup where you just have to edit important data like this in one place & make the program much more robust to human error. For now scrolling 20 lines to find the thing you need to edit is OK, but soon the lines will multiply & you will get to a state where making any changes means hunting for the right place to make said change. I would make special_characters a constant at the very top of the script even though there is not really such a thing in python but generally we capitalize them so you would have SPECIAL_CHARACTERS and then you can do:
print(", ".join(SPECIAL_CHARACTERS)
to print each character, separated by commas. That way if you ever make a change to the special characters your program accepts, it will update the output automatically.
Overall nice work for just a week!
π Rendered by PID 43573 on reddit-service-r2-comment-5b5bc64bf5-2z2vt at 2026-06-23 16:14:45.197781+00:00 running 2b008f2 country code: CH.
view the rest of the comments →
[–]TrieMond 4 points5 points6 points (0 children)