Difference between raw_input and input? (For your hobby - Loops)


#1

https://www.codecademy.com/en/courses/python-beginner-en-cxMGf/1/2?curriculum_id=4f89dab3d788890003000096


I figured out the correct answer to the problem, but I found the change I had to make was using "raw_input" instead of "input". I'm not sure what version of python the integrated console window runs, but I think it has something to do with my experience with the newer version of Python and using "input" as opposed to using "raw_input" that was a part of the older Python 2 version. I believe the issue has something to do with the output each function gives you, raw_input returns a string and input returns something else? Thanks again.

hobbies = []


for i in range(3):
    hobby = raw_input("What is a hobby of yours: ")
    hobbies.append(hobby)


#2

Find out what functions do by looking up their documentation (for the right version). Some documentation is available within python itself. You need to do this for just about any function that you use, how else would you figure out how they work?

help(raw_input)
help(input)
help(eval)

#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.