Python Forum
How to make global list inside function
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to make global list inside function
#5
Nope. It is still error
#Main Module

from output import menu

from userinput import userinfo, orders, food

menu()

userinfo()

orders()

print(userinput.choice)
Error:
Traceback (most recent call last): File "C:\Users\Owner\Desktop\Python Assignment\main.py", line 13, in <module> print(userinput.choice) NameError: name 'userinput' is not defined
Sad Sad Sad
Reply


Messages In This Thread
How to make global list inside function - by CHANKC - Nov-25-2020, 06:42 AM
RE: How to make global list inside function - by CHANKC - Nov-25-2020, 11:19 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  not able to call the variable inside the if/elif function mareeswaran 3 759 Feb-09-2025, 04:27 PM
Last Post: mareeswaran
  Make a list learningpythonherenow 1 978 Oct-11-2024, 11:49 AM
Last Post: Pedroski55
  Why doesn't list require global keyword? johnywhy 9 4,568 Jan-15-2024, 11:47 PM
Last Post: sgrey
  with open context inside of a recursive function billykid999 1 1,437 May-23-2023, 02:37 AM
Last Post: deanhystad
  Why do I have to repeat items in list slices in order to make this work? Pythonica 7 3,199 May-22-2023, 10:39 PM
Last Post: ICanIBB
  How do I call sys.argv list inside a function, from the CLI? billykid999 3 2,109 May-02-2023, 08:40 AM
Last Post: Gribouillis
  help me to make my password list in python >>> Oktay34riza 0 1,108 Dec-23-2022, 12:38 PM
Last Post: Oktay34riza
  Function global not readable by 'main' fmr300 1 2,221 Jan-16-2022, 01:18 AM
Last Post: deanhystad
  Need to parse a list of boolean columns inside a list and return true values Python84 4 3,460 Jan-09-2022, 02:39 AM
Last Post: Python84
  Make Groups with the List Elements quest 2 2,854 Jul-11-2021, 09:58 AM
Last Post: perfringo

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020