Suzie “Fedsie” Feodoroff▸ Years 7 – 8 Digital Technologies MOOC

Attached is the correct code for the simple chat program in Lesson 1 of the Raspberry Pi networking project +Anne Weaver If you come across any other issues let me know.

G+ Comments

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.

+ There are no comments

Add yours