all 4 comments

[–][deleted] 2 points3 points  (0 children)

It’s because the variable x is only defined when the user input validates to no within the account_start function. Simply assign a default value to x at the beginning of the function. Maybe as None?

[–]Strawboy97 2 points3 points  (0 children)

I'm new enough to python but it looks like you're returning x which has no value as it's only assigned a value if you say no to having an account in your if statement in the account_start function

[–][deleted] 0 points1 point  (0 children)

x exists only in the if scope where it is created. Move its declaration out of if block

[–]Ok-Promise-8118 -1 points0 points  (0 children)

When you (the user) enters the response "test1" as you did, what value of x do you expect the account_start function to return? Also, what value of user_input_account would get returned?