For some reason, a SyntaxError: invalid syntax error occurs in a place where, in theory, it should not have occurred:

 randlist = {buildblock(random.randint(3,5)): buildblock(random.randint(3,15)), buildblock(random.randint(3,5)): buildblock(random.randint(3,15)} 

Error indicates closing bracket } . Did I do something wrong?

Closed due to the fact that it was off topic by Nicolas Chabanovsky August 31 '16 at 4:48 .

It seems that this question does not correspond to the subject of the site. Those who voted to close it indicated the following reason:

  • "The question is caused by a problem that is no longer reproduced or typed . Although similar questions may be relevant on this site, solving this question is unlikely to help future visitors. You can usually avoid similar questions by writing and researching a minimum program to reproduce the problem before publishing the question. " - Nicolas Chabanovsky
If the question can be reformulated according to the rules set out in the certificate , edit it .

  • {buildblock (random.randint (* a)): buildblock (random.randint (* b)) for a, b in [[(3, 5), (3, 15)]] * * 9} - vadim vaduxa

1 answer 1

You have not closed the last buildblock( , put one parenthesis before the closing parenthesis.

  • Damn distraction. Thank. - JamesJGoodwin
  • @JamesJGoodwin, not at all. - Aim X
  • @AimX so these things need to write down the ladder;) - andreymal
  • @andreymal, and I found the mistake: D - Aim X
  • (oh, I should have mentioned at the beginning of the @JamesJGoodwin comment, but managed to miss it)) - andreymal