Ask coding questions

← Back to all posts
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
ReshiramWolfu (62)

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

Masy (21)

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

launcherman08 (8)

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

EvanKrainik (7)

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

KeaganLandfried (9)

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_

MATTHEWBECHTEL (122)

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