Ao treinar de forma autônoma em Python (v3.6.0), testei o seguinte comando:
print ('hello world!')
print ('what is your name?')
myName = input()
print ('it is good to meet you, ' + myName)
print ('The lenght of your name is: ')
print (len(MyName))
print ('What is your age?')
myAge = input()
print ('You will be ' + str(int(MyAge) + 1) + ' in a Year')
A execução saiu assim:
hello world!
what is your name?
Richard
it is good to meet you, Richard
The lenght of your name is:
Traceback (most recent call last):
File "C:/Users/Richard Carvalho/Documents/Alura/DEITA SÁIENCE/Python/hello.py", line 8, in <module>
print (len(MyName))
NameError: name 'MyName' is not defined
Por que isso ocorre?