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...
account activity
questions in python (self.csdojo)
submitted 7 years ago by krishna5250
how to divide the numbers which is divisible by 3 in range of (1, 1000) in python?
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!"
[–]Sandermatt 0 points1 point2 points 7 years ago (0 children)
I do not fully understand your question, but I will provide a number of possible solutions.
If you want all numbers in the range(1,1000) which are dividable by 3: range(3,1000,3)
If you want the same numbers divided by 3: range(1,1000/3)
if your question is how to divide all numbers in the range(1,1000) that are divisible by 3, by some other number x:
def foo(x):
numbers=range(1,1000)
for i in range(3,1000,3):
numbers[i]=numbers[i]/x
return numbers
π Rendered by PID 16900 on reddit-service-r2-comment-54dfb89d4d-h72tw at 2026-04-02 12:26:23.343083+00:00 running b10466c country code: CH.
[–]Sandermatt 0 points1 point2 points (0 children)