I've had this problem for a while, where some of my values will just refuse to store. It's most likely because of a rule which I am breaking somewhere, but after searching the Internet for quite some time and I can't find the problem.
Code:
#TO SET#
def min_count_set():
stancount = int(input("How many standard miners do you wish to start with? "))
if (stancount > 10000 or stancount < 0):
print("\n Please enter a valid number to start with. \n \n")
min_count_set()
else:
advcount= int(input("How many advanced miners do you wish to start with? "))
if (advcount > 10000 or advcount < 0):
print("\n Please enter a valid number to start with. \n \n")
min_count_set()
else:
ultrcount = int(input("How many ultra miners do you wish to start with? "))
if (ultrcount > 10000 or ultrcount < 0):
print("\n Please enter a valid number to start with. \n \n")
min_count_set()
else:
print("\n Returning you to the setup menu \n \n")
set_mining_values()
#TO PRINT#
def view_mining_values():
print("\n Printing all of the variables now.")
print("\n Number of standard miners starting with: ")
print(stancount)
print("\n Number of advanced miners starting with: ")
print(advcount)
print("\n Number of ultra miners starting with: ")
print(ultrcount)
The error I receive is:
NameError: name 'stancount' is not defined
I previously tried giving the variable stancount
a number and then run it through the input, but then it would just relay the number I gave it before the input.