Truth or Dare!
A fun code to play Truth or Dare with your friends! Have fun!
Welcome to the code! Stuck with boredom even when you have friends around? Ughhh… It happens. Play Truth or Dare with your friends with this simple code. Now you also learn while playing. Yipeeee!!
In this code, you can play Truth or Dare with your friends with pre-defined Truths and Dares.
Note: Loved the post? You too can publish your article on “Python for fun” which will be loved by millions. Contribute an article!
''' Welcome to the 'truth' or 'dare' game. 1. Input how many people are gonna play. 2. Enter the players names. 4. Choose Truth or Dare. 5. At the end of the program, computer gives you a Truth or Dare question. ''' import random #---------items of truth or dare-------- truth_items = ['What is your worst habit?', 'Do you sing in the shower?', 'Are you scared of the dark?'] dare_items = ['dance in the street like crazy.', 'Bark like a dog loudly.', 'take your shirt off spin it.'] #--------------------------------------- #times_gonna_play = input('please tell me how many times you want to play?') #times_gonna_play = int(times_gonna_play) number_of_players = input('How many people wants to play?') number_of_players = int(number_of_players) list_of_players =  answer = "yes" for i in range(number_of_players) : player_names = input("please enter player's name.") list_of_players.append(player_names) while answer == "yes" or answer == "y" : player = random.choice(list_of_players) print('its «', player, '» turn') truth_dare = input('please type "truth" to choose truth and "dare" to choose dare.') truth_dare = str(truth_dare) if truth_dare == 'truth' : print(random.choice(truth_items)) if truth_dare == 'dare' : print(random.choice(dare_items)) answer = input("Do you wanna continue the game?")