Sign up Free. Don't forget to check out our challenges, lessons, solve and learn series and more ...

Code Snippet

import random
import time

def displayIntro():
    print('You die and find yourself at a mysterious bus stop,')
    print('You notice one colourful bus headed down the hill, and another second grim looking bus with only one or two people heading toward it....')
    print('You need to decide which bus to get on....')
    print('Bus 1 looks fun, but Bus 2 is ....intereting')

def choosebus():
    bus = ''
    while bus != '1' and bus != '2':
        print('Which bus will you go into? (1 or 2)')
        bus = input()

    return bus

def checkbus(chosenbus):
    print('You approach the bus...')
    print('It is dark and spooky...')
    print('A large creature jumps out in front of you! He opens his jaws and...')

    friendlybus = random.randint(1, 2)

    if chosenbus == str(friendlybus):
         print('Says: "Good choice! Nice to meet you -do come with me...."!')
         print('Gobbles you down in one bite!')

playAgain = 'yes'
while playAgain == 'yes' or playAgain == 'y':


    busNumber = choosebus()


    print('Do you want to play again? (yes or no)')
    playAgain = input()

Try it yourself