[Tutor] Simple Python Program

Jason MacFiggen jmacfiggen at gmail.com
Sat Jul 31 06:00:26 CEST 2010


Can anyone tell me how to fix the errors I am getting if possible? I'm quite
new and so confused...

also how do I display the winner under the displayInfo function?

import random

def main():
    print

    playerOne, playerTwo = inputNames(playerOne, PlayerTwo)

    while endProgram == 'no':

        endProgram == no
        playerOne = 'NO NAME'
        playerTwo = 'NO NAME'

        winnerName = rollDice(p1number, p2number, playerOne, playerTwo,
winnerName)
        winnerName = displayInfo

        endProgram = raw_input('Do you want to end program? (Enter yes or
no): ')

def inputNames(playerOne, PlayerTwo):

    p1name = raw_input("Enter your name.")
    p2name = raw_input("Enter your name.")
    return playerOne, playerTwo

def random(winnerName):

    p1number = random.randint(1, 6)
    p2number = random.randint(1, 6)

    if p1number > p2number:
        playerOne = winnerName
    elif p1number < p2number:
        playerTwo = winnerName
    else p1number == p2number:
        playerOne, playerTwo = winnerName

def displayInfo():

    #how do I display winner?

main()
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20100730/ae8b2981/attachment.html>


More information about the Tutor mailing list