Answers for "can you import a variable inside a function from another python file"

1

how to import a variable from another python file

from file1 import x1
print(x1)
Posted by: Guest on April-12-2020
0

how to use variable from another function in python

>>> def oneFunction(lists):
        category=random.choice(list(lists.keys()))
        return random.choice(lists[category])


>>> def anotherFunction():
        for letter in oneFunction(lists):              
        print("_",end=" ")
Posted by: Guest on November-26-2020

Code answers related to "can you import a variable inside a function from another python file"

Python Answers by Framework

Browse Popular Code Answers by Language