Hello Codeacademy Python community. For once I am not ranting about a bug that was most likely me just not following directions, haha. I was thinking of comparing and contrasting these two solutions.
"""My version of PygLatin. It has far less variables but the if statement is not as clean and mine returns false if there's a space :(""" print("Welcome to PygLatin, a Pig Latin translator written in Python") print("Type in a word.") word = str(input()) if str.isalpha(word) == True: print(word[1:] + word + "ay") elif str.isalpha(word) == False: print('That is not a word. Try again without numbers or symbols')
"""This is CodeAcademy's version of PygLatin Their if statement is cleaner than mine however they use many more variables. """ pyg = 'ay' original = raw_input('Enter a word:') word = original.lower() first = word new_word = word + first + pyg new_word = new_word[1:len(new_word)] if len(original) > 0 and original.isalpha(): print new_word else: print 'empty'