Function Name Not Defined
I have a pice of code which looks like this if __name__ == '__main__': main() def main(): print('hello') However, when I try to run this code I get the error NameError
Solution 1:
You should define main before call it
def main():
print("hello")
if __name__ == "__main__":
main()
Post a Comment for "Function Name Not Defined"