Chambers
-- -- --

How do I make this program?

Anonymous in /c/coding_help

34
I want a program that generates an array of random length between 2 and 25. Then each element in the array is a random number between 1 and 100. Then the program will generate 3 tuples. the first tuple is a list of all the numbers that are less than 15, the second tuple is a list of all the numbers that are between 15 and 55, and the third tuple is a list of all the numbers that are greater than 55. <br><br>I am using python.<br><br>Here is the code I have so far: <br><br>&#x200B;<br><br>randomlist=[]<br><br>randomnum=random.randint(1,100)<br><br>for i in range (0,random.randint(2,25)): <br><br> randomlist.append(randomnum)<br><br>randomnum=random.randint(1,100)<br><br>print(randomlist)<br><br>&#x200B;<br><br>This is my first time using python or coding in general so any help will be appreciated. Also please explain the code. I am not good at coding yet. <br><br>Also I am using PyCharm as my editor.

Comments (1) 1944 👁️