Error flashes up breifly in a black box?

This is the place for queries that don't fit in any of the other categories.

Error flashes up breifly in a black box?

Postby drewster1123 » Wed Jun 11, 2014 10:48 pm

im very new to coding and ive looked up many different small codes like this just to try everything out and its hasnt been working.

ive been trying to make a dice rolling program. i found this code online but after i save the code to to my desktop as a .py file, i would click it to open it and a black box pops up for about half a second then goes away. it seems like it sais "syntax error" or "invalid syntax" can some body help me and tell me my problem

email: shogundrew@hotmail.com

Code: Select all
import random
min = 1
max = 6

roll_again = "yes"

while roll_again == "yes" or roll_again == "y":
    print "Rolling the dices..."
    print "The values are...."
    print random.randint(min, max)
    print random.randint(min, max)

    roll_again = raw_input("Roll the dices again?")


thanks alot
-Drew
Last edited by Yoriz on Wed Jun 11, 2014 11:51 pm, edited 1 time in total.
Reason: First post lock, Changed tittle.
drewster1123
 
Posts: 7
Joined: Wed Jun 11, 2014 10:19 pm

Re: making a dice rolling program

Postby metulburr » Wed Jun 11, 2014 11:28 pm

i would click it to open it and a black box pops up for about half a second then goes away. it seems like it sais "syntax error" or "invalid syntax" can some body help me and tell me my problem


Run the program from the command line to view the output, read this if you are unsure on how to do that
New Users, Read This
OS Ubuntu 14.04, Arch Linux, Gentoo, Windows 7/8
https://github.com/metulburr
steam
User avatar
metulburr
 
Posts: 1318
Joined: Thu Feb 07, 2013 4:47 pm
Location: Elmira, NY

Re: making a dice rolling program

Postby Yoriz » Wed Jun 11, 2014 11:50 pm

Are you using python 3? as that code is python 2.
You need to be carefull of overwritting built in keyword's, min and max are both built in keywords.
New Users, Read This
Join the #python-forum IRC channel on irc.freenode.net!
Spam topic disapproval technician
Windows7, Python 2.7.4., WxPython 2.9.5.0., some Python 3.3
User avatar
Yoriz
 
Posts: 725
Joined: Fri Feb 08, 2013 1:35 am
Location: UK


Return to General Coding Help

Who is online

Users browsing this forum: No registered users and 3 guests