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 trialChokdee Srisuk
19,384 PointsI use Python 2.7.8 and I notice that a function input() can't work with datatype of string. Using raw_input is a must.
I use Python 2.7.8 and I notice that a function input() can't work with datatype of string. Using raw_input is a must. Are there any other ways to use input() in the program rather than using raw_input if python is 2.7.8?
3 Answers
Kenneth Love
Treehouse Guest Teacherinput()
exists in Python 2 but it's stupid. It takes the user's input and then tries to run it as valid, live Python code. This can open you up to all sorts of security issues, as I'm sure you can imagine.
Tobias Edwards
14,458 PointsAs far as I know, you can only get input from the user using raw_input() in Python 2.7.8.
Charlie L.
10,120 PointsI believe python 2.7 only uses raw_input() which was later changed to input() in python 3.3+.