DEV Community

عاشق الابداع
عاشق الابداع

Posted on

Guess whose gonna pay

import random
print("Welcome to 'whose wallet ?'")
name = input("""You will give me a list of names, and I will pick a person to pay
If you're ready, enter the names separated by a comma: \n """)
if name:
choice = name.split(",")
which_one = random.randint(0,len(choice)-1)
else:
print("You should add a list")
print(f"Please ask {choice[which_one]} to take his wallet out, Dinner is on him")

Top comments (0)