0

How can I get Random number with python?

Here is scrip I wrote.. It doesn't work. Import randint for i in range(15) x=random.randint(5,100) print x You might know what I wanted to get. I tried to get 15cases random numbers between 5 to 100. I dont figure out which point is wrong Python told me 'indentationerror' Please solve this problems ~

25th Jul 2016, 12:02 PM
shin eun kyung
shin eun kyung - avatar
3 Answers
+ 2
oh and the indentation error,you forgot the colon after the loop statement
25th Jul 2016, 12:11 PM
Gershon Fosu
Gershon Fosu - avatar
+ 1
Well the module you wanna import from is random. randint is the method. I guess you were close enough.
25th Jul 2016, 12:08 PM
Gershon Fosu
Gershon Fosu - avatar
0
yes. I fixed import moduel form randinst to random and. Adjusted spaces between lines. That is why it shows me 'indentation error' Line space always make me confused TT (Colon , I missed type here) Anyway thank you!
25th Jul 2016, 12:25 PM
shin eun kyung
shin eun kyung - avatar