Ask coding questions

← Back to all posts
DragoniteDL (1)

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

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

ReshiramWolfu (82)

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

Masy (29)

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

launcherman08 (22)

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 (27)

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_


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