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

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jo26
    New Member
    • Jan 2019
    • 1

    #1

    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:

    Code:
    from random import randint
    while true:
        (randint(10, 30)) = answer1
        (randint(10, 30)) = answer2
        int('what is',answer1,'plus',answer2)
    It is unfinished, so it might be the rest of the code.
    Last edited by jo26; Jan 30 '19, 02:27 PM. Reason: i needed to explain some more and add the code function
  • dwblas
    Recognized Expert Contributor
    • May 2008
    • 626

    #2
    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

    Comment

    Working...