#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Posts
    28
    Rep Power
    0

    what wrong with this program it won't work


    import random
    die1 = random.randrange(6)+1
    die2 = random.randrange(6)+1
    total = die1 + die2
    raw_input('press the enter key to exit')
  2. #2
  3. No Profile Picture
    I AM A GOLDEN GOD
    Devshed God 1st Plane (5500 - 5999 posts)

    Join Date
    Apr 2003
    Location
    Camarillo, California
    Posts
    5,932
    Rep Power
    1166
    Works for me; although it really doesn't 'do' anything. What were you expecting?

    Try
    Code:
    import random
    die1 = random.randrange(6)+1
    die2 = random.randrange(6)+1
    total = die1 + die2
    print die1, die2, total
    raw_input('press the enter key to exit')
    "Seriously, we're not a search engine, we're actual people." ~ ManiacDan

    BookMooch.com : Give books away. Get books you want.
  4. #3
  5. Hello World :)
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2003
    Location
    Hull, UK
    Posts
    2,537
    Rep Power
    69
    I dont see a problem here either although you might want to try the randint() function instead. Geeks right though, this doesn't really do anything anyway so its kinda hard to guess what you want . Gonna give us a hint?

    Mark.
    programming language development: www.netytan.com Hula


IMN logo majestic logo threadwatch logo seochat tools logo