Home > Software engineering >  How do I use the .random module on a list to get a random item out without using .choice?
How do I use the .random module on a list to get a random item out without using .choice?

Time:10-12

I'm a total begginer in programming :)

I'm trying to solve a coding challange which instructs me to pick a random name out of a list but i'm not allowed to use the .choice function instead I somehow need to pick an item out using the len() function in my code.

# Split string method
names_string = input("Give me everybody's names, separated by a comma. ")
names = names_string.split(", ")
#            
  • Related