can anyone help me to find the error in this python code, because sometimes it runs and sometimes it shows an error and sometimes it even don't gives an output !
names_string = input("Give me everybody's names, separated by a comma.\n")
names = names_string.split(", ")
# print(len(names))
number_of_members = (len(names))
# print (number_of_members)
import random
randominteger = random.randint (0,number_of_members)
if randominteger == 0 :
print (f"{names[0]} is going to buy the meal today!")
elif randominteger == 1 :
print (f"{names[1]} is going to buy the meal today!")
elif randominteger == 2 :
print (f"{names[2]} is going to buy the meal today!")
elif randominteger == 3 :
print (f"{names[3]} is going to buy the meal today!")
elif randominteger == 4 :
print (f"{names[4]} is going to buy the meal today!")
jay , mack , mona , sujal , sundar - this was my input when I ran the code.
![this python code is randomly shows error , sometimes it runs and sometimes it doesn't shows any error and still I don't get any output [closed]](https://file.115kc.com/storage/eg/image433.jpg)