one plus one, 2 comments
- Bruce Fuda: Hey + Suzie Feodoroff – shouldn’t that phrase line be phrase = input() for py3? The fact that it is working with print “chat” vs print(“chat”) would suggest that the code provided is using Python 2, which is why that code works. Python 3 would require all print statements to be changed to print(“xx”) instead, and input() instead of raw_input() 🙂
- Suzie âFedsieâ Feodoroff: Thanks +Bruce Fuda It originally had phrase = input() but it didn’t work until I changed it to phrase = raw_input(). I did take the brackets out at one stage but just didn’t put them back in once it ran okay. I’d spent hours trying to work out what was wrong as I’m fairly new to coding. I didn’t bother going back to check whether it would still work with print (” “). It works without as is. So it must be running Python 2 then. That’s fine because it just means that all I have to change is the comment – that it is Python 2. The code is correct. And the original code for Python 3 doesn’t work. At least on our Pi’s.
You must log in to post a comment.