I have been trying to use lists so I can separate my integers into something organized (which lists are made to do, right?). Making these integers as random numbers are also makes this a little more confusing. This is what I have so far:
import random
first_list = []
for first_num in range(5):
first_list = (random.randint(1,9))
print ("First List",first_list)
for x in range(5):
num_two = random.randint(2,8)
print ("Second List",num_two)
My display is random numbers going down with my printed First List/Second List connected to every number.
First List:8 First List 3 etc. Second List:3 Second List 7 etc.
Second part of my assignment is to use to compare elements in the two lists in pairs, i.e., compare the first elements in both lists, compare the second elements in the both lists which has to show the larger number in each comparison. I just wanted to show what the conclusion is as to why I need help with y'all in the first place.
Aucun commentaire:
Enregistrer un commentaire