在我的初学者看来,没有明显的原因会出现python语法错误。怎么回事,如何解决? [关闭]

我正在尝试制作自己的密码生成器。我知道它看起来可能真的很自闭并且过于简化,但是我是新手并且正在学习,所以以后我会为此担心。我一直在外壳中收到此错误。

j=str(random.randint(0,9)) ^ SyntaxError: invalid syntax

我的下面的代码

import random

a=str(random.randint(0,24))
b=str(random.randint(0,24))
c=str(random.randint(0,24))
d=str(random.randint(0,24))
e=str(random.randint(0,24))
f=str(random.randint(0,24))
g=str(random.randint(0,24))
h=str(random.randint(0,24))
i=str(random.randint(0,24)
j=str(random.randint(0,9))
k=str(random.randint(0,9))
l=str(random.randint(0,9))


if l == '0': l = '!'
if l == '1': l = '@'
if l == '2': l = '#'
if l == '3': l = '$'
if l == '4': l = '%'
if l == '5': l = '^'
if l == '6': l = '&'
if l == '7': l = '*'
if l == '8': l = '('
if l == '9': l = ')'

print(a+b+c+d+e+f+g+h+i+j+k+l)