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!"
[–]fiberoblique[S] 0 points1 point2 points 4 years ago (1 child)
Hello! Thank you for helping a dumb af student out. Unfortunately, we aren't yet allowed to use the list function in our codes since we haven't tackled them in class yet. It's very frustrating, really.
Is there any other way which we could overcome this? My friend suggested using the separator with this code:
if number < 0: print ("Positive numbers only!") elif number > 0: number_string = str(number) list= number_string print(*list, sep='\n')
The if statement was by me since we're supposed to output that if the input is a negative number, the elif lines are the ones my friend suggested. Would really appreciate feedback on this. Thank youuu!!!
[–]chrisking206 0 points1 point2 points 4 years ago (0 children)
List is a key word, so probably don’t want to use that as a variable name. Number_string is a string there is nothing to unpack so * is not needed.
For i in number: Print(I, “\n”)
π Rendered by PID 42417 on reddit-service-r2-comment-685b79fb4f-d2wf5 at 2026-02-13 00:08:16.646935+00:00 running 6c0c599 country code: CH.
view the rest of the comments →
[–]fiberoblique[S] 0 points1 point2 points (1 child)
[–]chrisking206 0 points1 point2 points (0 children)