10. Ending Up


#1

When I type an all uppercase word, it doesn’t return it lower cased…

pyg = 'ay'

original = raw_input('Enter a word:')

if len(original) > 0 and original.isalpha():
    word = original.lower()
    first = word[0]
    new_word = word + first + pyg
    print original
else:
    print 'empty'

#2

it does, but the lower case conversion is stored in word variable, you never print this variable. the only variable you print (original) still contains the original string entered by the user


#3

So the program stores it lowercased but won’t show it when the pig latin phrase is printed?


#4

yes

it would, but you never print the pyglatin phrase.


#5

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