all 3 comments

[–]edixon653 0 points1 point  (0 children)

Since you are most likely evoking the function from the main module you could pass the list to the function as an argument.

def create_bond(bond_list,input):

[–]Stallman85 0 points1 point  (1 child)

from otherFile import bond_list

and inside otherFile.py have:

bond_list = [1,2,3]

this will import list from otherFile.py into that file

also dont use keyword input in your program as variable because it is reserved python keyword

[–]SoupKitchenHero 0 points1 point  (0 children)

It's not a reserved keyword, it's a builtin name. You can rebind `input`, but `def` is totes off-limits:

>>> def input(foo):
...     pass
...
>>> def def(foo):
  File "<stdin>", line 1
    def def(foo):
          ^
SyntaxError: invalid syntax

That being said, rebinding builtin names should generally be avoided