Ask coding questions

← Back to all posts
Global error
JeremyIrwin (44)

it's saying
File "", line 93
global magicmarp_pool
SyntaxError: name 'magicmarp_pool' is parameter and global

Answered by Geocube101 (645) [earned 5 cycles]
View Answer
Geocube101 (645)

Variables cannot be both global and a function parameter (which is local)
If you would like it to be global then remove the function parameter, though if you need it to be a function parameter (local) then remove the global declaration on line 93

Coder100 (18930)

You are using a variable that is already a parameter! Look at the line 92:

def __init__(self, chance, level, fighting, magicmarp_pool):

so please rename the variable on line 93 and 94, or just remove the argument on line 92 entirely.

Also, on lines 95 to 97 you indented when you should have unindented

JeremyIrwin (44)

@Coder100 (I'm terrible with parameters) thanks!