I have got a database program to keep data in, and I can't solve this problem:
I have got two functions. When you input A into the program the function called addy() starts and ask for more input into a variable then it returns to the main screen, then the user can Input S which starts Show() and then it's supposed to show what you have added into the variable
PROBLEM: It's not getting the value from the previous definition.
CODE:
def addy():
os.system('cls')
addel = input('what is the name of the operating system?: \n')
os.system('cls')
time.sleep(1)
print(addel + ' Has been added to the database!')
time.sleep(2)
program()
def show():
print('Heres a list of the operating systems you have added:')
time.sleep(5)
program()
addel = addy()
print(addel) # this should print the value from the previous function