Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialdjsands
6,286 PointsSo 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
20,315 PointsTry 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.
djsands
6,286 Points[alt text](C:\Users\distj\Desktop\DeskTop\resources\treehouse\26.python\img "15.jpg")