Gambling Script Help - Printable Version +- Support Forums (https://www.supportforums.net) +-- Forum: Categories (https://www.supportforums.net/forumdisplay.php?fid=87) +--- Forum: Coding Support Forums (https://www.supportforums.net/forumdisplay.php?fid=18) +---- Forum: Python Programming Language (https://www.supportforums.net/forumdisplay.php?fid=32) +---- Thread: Gambling Script Help (/showthread.php?tid=1796) Pages:
1
2
|
Gambling Script Help - Mr.FeellingLeSS - 10-19-2009 hey guys. I'm making a gambling script(will be posting it soon) but am i running against a problem. error: Code: Traceback (most recent call last): script part: Code: elif rnuserchosencolour==rnchosencolour: so can you guys help me?( rnwoncash is a number) RE: Script problem... - Gaijin - 10-19-2009 (10-19-2009, 09:20 AM)Mr.FeellingLeSS Wrote: (line217)print "You won by colour! Profit: "+rnwoncash Change the line to Code: print "You won by colour! Profit: ", rnwoncash In Python you get a problem when you use "+" with 2 different types of data, since your var "rnwoncash" is integer you can't use "+" to add it to your string... RE: Script problem... - Mr.FeellingLeSS - 10-19-2009 (10-19-2009, 09:24 AM)NinjaGeek Wrote: Change the line to thanks for the quick respone i will change it. RE: Script problem... - Gaijin - 10-19-2009 (10-19-2009, 09:32 AM)Mr.FeellingLeSS Wrote: thanks for the quick respone i will change it. I'm here to help, and for the future please use the code tags when showing code snippets Code: [code]Your code [ /code](without the whitespace in the closing tag) RE: Script problem... - Mr.FeellingLeSS - 10-19-2009 (10-19-2009, 09:35 AM)NinjaGeek Wrote: taken care of RE: Gambling Script Help - Omniscient - 10-19-2009 Please don't change thread titles into nonsense. RE: Gambling Script Help - Fallen - 10-19-2009 since rnwoncash is an int, to concentrate it with a string you must turn it into a string. Code: print "You won by colour! Profit: " + str( rnwoncash ) should do RE: Gambling Script Help - Mr.FeellingLeSS - 10-20-2009 guys i got an other problem Code: import os it won't clear, though i don't get a error... it just skips clearer like it means nothing... RE: Gambling Script Help - Gaijin - 10-20-2009 (10-20-2009, 10:06 AM)Mr.FeellingLeSS Wrote: it won't clear, though i don't get a error... It does clear on XP, what are you using Vista or 7? EDIT: aahhhh I got what you were trying to do, you are calling the variable "clearer" but that is the wrong way try defining a function, try this: Code: import os RE: Gambling Script Help - Mr.FeellingLeSS - 10-20-2009 Thanks for the quick response i see what i did wrong fixing it now [/align] |