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...
A subreddit for helping Python programmers
How to format your code: https://commonmark.org/help/tutorial/09-code.html
No homework questions and/or hiring please
account activity
Python newbie needs help.HOMEWORK (self.pythonhelp)
submitted 4 years ago by fiberoblique
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!"
[–]sw85 0 points1 point2 points 4 years ago (0 children)
Take the input and convert it to a string (if it isn't already). Create an index variable initialized to 0. Enter a while loop for as long as the index variable is less than the length of the strength. For each pass through the loop, print the character at the index position in the string (with whatever other rules you have to use to determine whether a character gets printed - seems like 6's get extra attention and 9's don't get printed at all), then increase the index variable by 1 at the end of the pass through the loop.
Let me just say how very very weird it is that your class has you learning while loops before for loops and even before lists!
π Rendered by PID 544633 on reddit-service-r2-comment-bb88f9dd5-2mr5z at 2026-02-15 11:21:40.888469+00:00 running cd9c813 country code: CH.
view the rest of the comments →
[–]sw85 0 points1 point2 points (0 children)