Ask coding questions

← Back to all posts
2
Help??
DragoniteDL (1)

Um, I'm pretty basic at python, but why doesn't this work?

https://repl.it/@DragoniteDL/Poptropica-Name-Demo

It's supposed to cycle through names, and then choose one, but it's not working? (Really Confused)

Commentshotnewtop
1
ReshiramWolfu (59)

Declare the variables.
var1= int/str/bool/float()

1
Masy (17)

Hey @DragoniteDL , You Need to define your Vars as functions

1
launcherman08 (6)

Just one question, what are all the ones for? (var1, var2, var3)

1
EvanKrainik (7)

I don't think that the variables are in the correct scope.

1
KeaganLandfried (5)

Hey, you need to define the variables you want to use inside the def() function as a 'global' variable inside the def() function.
def name1():
global var1_

1
MATTHEWBECHTEL (121)

I’m no expert, but I’m pretty sure you have to define the variables before you use them. @DragoniteDL