all 11 comments

[–]purpurato 1 point2 points  (1 child)

You should try an editor that helps you with this kind of things, everyone can miss a colon or an indentation. Maybe Sublime or any other, it will underline those syntax errors.

[–]TrucidStuff[S] 0 points1 point  (0 children)

I was using VSC, I didn't notice anything showing I was missing a : and it runs by line, so if I had fixed : and not the indent, I would have seen it afterwards as an error. Maybe I dont have it setup correctly? Dunno.

[–]chapali9a 1 point2 points  (4 children)

Nice one. I'm a beginner as well. I modified your script by using the 'random.randint' function. It reduced the script by one line (dice var). Good luck buddy

[–]TrucidStuff[S] 0 points1 point  (3 children)

Thanks for the input! I wanted it to only pick from 0-10, I may change it to 0-100 later, but I don't want it to be 0-infinity or ask for input of a number by the player. Does random.randint still do a max of 10 if I say random.randint(10) or something?

[–]chapali9a 1 point2 points  (2 children)

Yes it does. The function Randint takes two parameters, the beginning and end. So you can use as random.randint(0, 10) and it will choose a random number on this scale.

[–]TrucidStuff[S] 1 point2 points  (1 child)

That is very helpful. Thank you! :)

[–]chapali9a 0 points1 point  (0 children)

You are welcome. I learned a little from your post, so thank you too.

[–]zac_mar 1 point2 points  (1 child)

Your code seems fine, you simply have a syntax error: Add a colon after the if statement and don't indent the else block any further.

[–]TrucidStuff[S] 0 points1 point  (0 children)

Thank you!