Traceback (most recent call last): File “input_test.py”, line 1, in name = input(“What’s your name? “) File “”, line 1, in NameError: name ‘Frank’ is not defined

  Python

Email

 name = input("What's your name? ")
What's your name? "John"
>>>
>>> age = input("Your age? ")
Your age? 38
>>> print(age, type(age))
(38, <type 'int'>)
>>> colours = input("Your favourite colours? ")
Your favourite colours? ["red","green","blue"]
>>> print(colours)
['red', 'green', 'blue']
>>> print(colours, type(colours))
(['red', 'green', 'blue'], <type 'list'>)
>>>
Spread the Code

Leave a Reply

avatar

This site uses Akismet to reduce spam. Learn how your comment data is processed.

  Subscribe  
Notify of