I'm not sure what to call this so I'll just explain what I need to do
Say I have the following script that gets a user inputs:
#test0.py
import functions
number = input('pick a number')
functions.dothis()
and this:
#functions.py
def dothis():
global number
if number == 1:
print('the number is 1')
else:
print('the number is not one')
this obviously shoots out 'number' is not defined
.
How do I pass number
into the dothis()
function or am I going about this entirely the wrong way ?
cheers!