NameError: name 'y' is not defined

Why my code is wrong?

The mission link:https://app.dataquest.io/m/316/functions%3A-intermediate/6/returning-multiple-variables

Hi @Maho,

You cannot use the variables x and y outside the function (because you initialized and assigned them inside the function). Instead, you can obtain your header and apps_data directly from the all_data, which you created using the defined function:

header = all_data[1]
apps_data = all_data[0]
2 Likes

Thanks, @Elena_Kosourova

1 Like