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: 8
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
we will be moving to python-forum.io on October 1 2016
more details here
User avatar
metulburr
 
Posts: 2226
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.
Due to the reasons discussed here we will be moving to python-forum.io/ on October 1 2016
This forum will be locked down and no one will be able to post/edit/create threads, etc. here from thereafter. Please create an account at the new site to continue discussion.
User avatar
Yoriz
 
Posts: 1669
Joined: Fri Feb 08, 2013 1:35 am
Location: UK


Return to General Coding Help

Who is online

Users browsing this forum: buran and 3 guests