Lesson 5: Lists in Python

posted Nov 5, 2019, 7:57 AM by Attila Lengyel
bronze = ["Marc"]
bronze.append("Neil")
bronze.append("Celina")
bronze.append("Ariana")
bronze.append("Jacob")
bronze.append("Soha")
bronze.append("Bryn")
bronze.append("Ben")
bronze.append("Parsa")
bronze.append("Naitik")
bronze.append("Nikhil")
bronze.append("Kalin")
bronze.append("Kian")
bronze.append("Ayan")
bronze.append("Supriya")
bronze.append("Johann")
bronze.append("Elizabeth")
bronze.append("Anuva")
bronze.append("Alexsys")
bronze.append("Arjun")
#print(len(bronze))
#print(bronze)
#print(bronze[3])

import random
player1 = random.randint(0, len(bronze)-1)
player2 = random.randint(0, len(bronze)-1)
print(bronze[player1], "please play against", bronze[player2])

bronze.sort()
print(bronze)
bronze.reverse()
print(bronze)











Comments