468,505 Members | 1,921 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,505 developers. It's quick & easy.

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

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
1 2129
626 Expert 512MB
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.

Similar topics

6 posts views Thread by Fuzzyman | last post: by
7 posts views Thread by lordkain | last post: by
6 posts views Thread by Don Lancaster | last post: by
34 posts views Thread by Srinu | last post: by
reply views Thread by NPC403 | last post: by
reply views Thread by fmendoza | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.