Say an input was defined as this within one defined script:
def Login():
log = input ('\nLogin (Case sensitive): ')
There is more code after this within Login(), nevertheless the above is where log is initially defined. Is there any way I can use this defined input within another defined script? For example, what I want to do is allow log to be used within another defined script:
def LoggedInStudent():
print ('Hello, student. Would you like to: \n1: Attempt this weeks spelling test \n2: Log out')
studentchoiceinput = input ('')
if studentchoiceinput == ('1'):
if log in y3list:
Y3SpellingTest()
if log in y4list:
Y4SpellingTest()
if log in y5list:
Y5Spellingtest()
if log in y6list:
Y6SpellingTest()
Is there any way to have 'log' defined within the latter script without having the user have to input their 'username' again or without moving the latter script into where 'log' is initially defined? I want to do this because I do not want to have the user of my program have to 'log out' of it whenever they need to be returned to the 'menu'.
Thanks in advance for the help.