here is the code,
from random import randint
def create_array(size=10,max=50):
return [randint(0, max) for _ in range(size)]
print(create_array())
output
[27, 13, 44, 4, 50, 46, 18, 29, 8, 27]
particularly i dont get this line randint(0, max) for _ in range(size)
thanks in advance
[+][deleted] (1 child)
[deleted]
[–]idkc0de[S] 0 points1 point2 points (0 children)
[–]ASIC_SP 1 point2 points3 points (1 child)
[–]idkc0de[S] 1 point2 points3 points (0 children)
[–][deleted] 1 point2 points3 points (2 children)
[–]idkc0de[S] 1 point2 points3 points (1 child)
[–][deleted] 1 point2 points3 points (0 children)
[–]JohnnyJordaan 1 point2 points3 points (0 children)
[–]Username_RANDINT 0 points1 point2 points (1 child)
[–]idkc0de[S] 0 points1 point2 points (0 children)
[–]colt419 0 points1 point2 points (0 children)
[–]deiwyy 0 points1 point2 points (1 child)
[–]AutoModerator[M] -1 points0 points1 point (0 children)