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 trial

Python Python Basics (Retired) Ins & Outs Basic I/O

input vs raw_input: Python 2.7

Using the input() function in Python 2.7 doesn't allow the user to simply type SPAM. There actually has to be a conversion, so the user must wrap the string in quotation marks like "SPAM" to force a string type conversion. IN FACT, the documentation states "Consider using the raw_input() function for general input from users." In Python 3 any input is automatically converted to a string, so this isn't an issue for that version. Was there something indicating that I should only be using Python 3 for this?

https://docs.python.org/2/library/functions.html#input

2 Answers

Kenneth Love
STAFF
Kenneth Love
Treehouse Guest Teacher

I don't repeatedly say we're using 3.4 but all of the Python interpreters in the videos list Python 3.4.0, the second video in the first stage states that we'll be using Python 3.4 for the entire course, and the first quiz has a question about what version of Python we're using (the only correct answer is 3.4). Sorry that wasn't clear for you. Is there anywhere you can suggest that we make it clearer that we're using 3.4+ only?

Perhaps you could have a video dedicated to a brief history of Python and the broken compatibility that 3.x introduced? That might be overkill though. I usually just glance at the Teacher's Notes, so that's my fault. I'm assuming that most users will be using Workspaces, so I'm probably an anomaly.

Kenneth Love
Kenneth Love
Treehouse Guest Teacher

A video on the history of Python would be interesting but I'm not sure if it would actually contribute to anyone's learning to use Python. I'll keep it in mind, though, for future updates to the courses. Thanks!

Sanjay Noronha
Sanjay Noronha
7,296 Points

This is an old post but relevant. I faced this issued but its an issue no longer. Thanks.