Why doesn't the following allow me to use the "os" variable once it's returned by the function? The "os" module isn't being imported so that shouldn't be an issue at all. When I call the Begin() function and print the os variable after the function is finished, python says the variable is not defined.
def Begin():
os = raw_input("Choose your operating system:\n[1] Ubuntu\n[2] CentOS\nEnter '1' or '2': ")
if os != '1' and os != '2':
print "Incorrect operating system choice, shutting down..."
time.sleep(3)
exit()
else:
return os
Begin()
print os
os
as a variable name -- it's the name of a well-known module. – nneonneo 9 mins ago