I'm having some problems with this:
I have two files: random and random2
random has this:
import random2
print(random2.verb_list)
print(random2.x)
random2 has this:
verb_list = ['x', 'y', 'z']
other_list = ['1', '2', '3']
something_else = False
def Main():
global x
x = 1
print(verb_list)
if __name__ == "__main__":
Main()
It gives me this error when I run random:
AttributeError: module 'random2' has no attribute 'x'
Is there a way so I can call the variable x in random? I have python3
xoutside your function