Ask your own question, for FREE!
MIT 6.189 A Gentle Introduction to Programming Using Python (OCW) 13 Online
OpenStudy (anonymous):

This part seems broken at CourseAcademy. The exercise is here http://www.codecademy.com/courses/python-beginner-2W5v7/0?curriculum_id=4f89dab3d788890003000096/#!/exercises/3 (does that link work for you?) My code looks like this print 'Welcome to the English to Pig Latin translator!' print 'Enter a word:' original = raw_input() size = len(original) if size > 0: print original else: print "empty" When I run it, I'm informed that I should be using an "if" statement with an "else". Any idea what I can do to trick it further? P.S. I have no idea whether the group of people in here is the same as or bigger than or smaller than the other groups on the other sites for the MOOC course. It's confusing.

OpenStudy (anonymous):

Is the indentation of the print statements correct? I had problems with CA. ,I pasted the code into IDLE and checked it there. If the code is ok try the enter return key on your keyboard or tap on C A's run button a few times.

OpenStudy (anonymous):

Actually the print statements' indentation was goofy but that didn't break it, since it was still broken after I fixed that! Hmm I have an issue with another part of it too. In the AEIOU exercise my output is "consonant" and the runner-gadget is telling me that the first letter of my word is a consonant and that therefore my program has something wrong with it. (It may have something else wrong with it, but ... I passed the exercises in between there ....) .. let me get back to you in a moment, I hate switching windows so much! ....

OpenStudy (anonymous):

Ok for EIEIO exercise it's confused if my input word has an initial capital letter. Otherwise it's all working OK. For pyg = 'ay' original = raw_input('Enter a word:') if len(original) > 0 and original.isalpha(): word = original.lower() first = word[0] if first in "aeiou": print "vowel" else: print "consonant" else: print 'empty' For the first exercise I complained about, if I clear out a bunch of comments at the top of the window that I'd entered to tell myself what the overall plan was, then it quit being confused, so that is good. thank you for having a look!

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!