By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,495 Members | 1,329 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,495 IT Pros & Developers. It's quick & easy.

Can't assign to function call error. Please help!

P: 1
Im trying to make a maths quiz, but when i try to run it, it says that. heres the code:

Expand|Select|Wrap|Line Numbers
  1. from random import randint
  2. while true:
  3.     (randint(10, 30)) = answer1
  4.     (randint(10, 30)) = answer2
  5.     int('what is',answer1,'plus',answer2)
It is unfinished, so it might be the rest of the code.
Jan 30 '19 #1
Share this Question
Share on Google+
1 Reply


Expert 100+
P: 606
randint is a function. Note the parens, (), and you are trying to make randint(10, 30) take on the value that is stored in answer1 --> (randint(10, 30)) = answer1
Jan 31 '19 #2

Post your reply

Sign in to post your reply or Sign up for a free account.