how can i split up a number ? for example (10 should look like a 1,2,3,4,5,6,7,8,9,10)
I'm a beginner so please don't go crazy with an answers
how can i split up a number ? for example (10 should look like a 1,2,3,4,5,6,7,8,9,10)
I'm a beginner so please don't go crazy with an answers
therefore you could simply use a for loop. which looks something like this:
for i in range(10):
print i
Try this:
import numpy as np
x = 10
answer = np.arange(1,x+1)
Now answer is a numpy array of numbers going from 1 to 10.
numpy
for this?! Just like saying: "First, install MATLAB. Then, simply use linspace(1,10,10)
."