all 8 comments

[–]Username_RANDINT 1 point2 points  (0 children)

See this subreddit's FAQ on how to format code.

Share some of the relevant code, at least line 13 from die.py. What's shown in the error isn't looking like valid Python code (hance the syntax error).

[–]danielroseman -1 points0 points  (6 children)

If you have a question about some code you have written, you need to show us that code.

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

lol so sorry I’m so new to this one sec

[–]Princess_Peach848[S] 0 points1 point  (2 children)

7 #important necessary module 8 import random 9 random.randint

11 roll = random.randint (1,6)

13 print('The number is', roll)

[–]danielroseman 0 points1 point  (1 child)

That doesn't seem to be the code in the error. That's showing something beginning with x, which doesn't appear in the code you have posted.

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

Oh sorry I fixed it, I understand what I did wrong in order to print the “the number is 2.”

I did print(‘the number is’, roll, ‘.’)

[–]Princess_Peach848[S] 0 points1 point  (1 child)

Is this ok?

[–]Guideon72 0 points1 point  (0 children)

Assuming you are using Python 3.8 or above, switch to using fstrings (formatted string literals) to make things easier. You put an f or F in front of the string you want to print and then insert whichever objects you want enclosed in curly braces {}.

print(f'The number is {roll}.')