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 In the above example Output: 47
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)
88
54
57
66
Article Contributed By :
|
|
|
|
1271 Views |