Python Python Basics All Together Now Gather Information

So why is my code accepted and ok in the treehouse workspace but not in my VS code editor??

its the exact same code but not working the same , is there something I am missing??

the workspace ; https://w.trhou.se/63e7h80afw

this is what VS code says ..

Windows PowerShell Copyright (C) Microsoft Corporation. All rights reserved.

Try the new cross-platform PowerShell https://aka.ms/pscore6

PS C:\Users\distj\Desktop\DeskTop\resources\treehouse\26.python\project1> python masterticket.py There are 100 tickets left. What is your name? diana Traceback (most recent call last): File "masterticket.py", line 7, in <module> name = input("What is your name? ") File "<string>", line 1, in <module> NameError: name 'diana' is not defined

2 Answers

Josh Keenan
Josh Keenan
19,311 Points

Try using, python3 masterticket.py, workspaces is using python 3 by default, but the python command on a local machine would default to using python 2.7 if I am not mistaken. In python 2 the raw_input() function would be needed to get string based input.

[alt text](C:\Users\distj\Desktop\DeskTop\resources\treehouse\26.python\img "15.jpg")