- 1
Python
Hello.. i need help coding a prog. for listing even numbers within a particular range say 100...thn listing numbers divisible by say 3....within the same range.
4 odpowiedzi
+ 1
do you want to code us?
or need any specific help?
+ 1
do you want us to code for you?
or need any specific help?
+ 1
for i in range(100):
if i % 2 == 0: # This gets all even numbers 0-100
print(i)
if I % 3 == 0: # This gets all numbers divisible by 3 0-100
print(i)
You can modify this as needed to print or add numbers to a list etc.
Or
for i in range(0, 100, 2):
print(i)
for i in range(0, 100, 3):
print(i)
0
yeah... i need the exact code, if you don't mind. thanks in advance.