In this Python array example tutorial, "Create an Array which will store integeres. Generate Random numbers and add them in created list and finally display the list items"
Let's write program
from array import * import random nums=array('i',[]) for i in range(0,5): num=random.randint(1,100) nums.append(num) for i in nums: print(i) |
In the above example
Output:
47 |
Article Contributed By :
|
|
|
|
1916 Views |