Is there any logic why it is acceptable to have variables with capital letters (e.g. myName = "Jason"
) inside if __name__ == "__main__":
but not inside def main():
?
EDIT : as apparently there is confusion, I got this conclusion by activating PEP 8 warnings and finding out that I didn't have warning in one case but had them in the other case :
Code to reproduce the behaviour:
def print_hi(name):
myName = "Jason"
print(myName)
if __name__ == '__main__':
myNameTest = "JasonTest"
print(myNameTest)