Pyg Latin Exersize 8


#1

Not sure how to include variables inside my if statement:
pyg = 'ay'

original = raw_input('Enter a word:')

if len(original) > 0 and original.isalpha():
print original
else:
print 'empty'

Instructions:
Inside your if statement:
Create a new variable called word that holds the .lower()-case conversion of original.
Create a new variable called first that holds word[0], the first letter of word.


#2

It's no different from the way you did it outside the if statement (pig = 'ay' you created a variable called pig that stores a string).

So maybe it should look like this...

if condition:
    variableWord = #something
    variableFirst = #another thing
else:
    #something else

The next thing should be thinking how to fill these variables! Hope it helps.


#3

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