Pyg Latin Exersize 8


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
print 'empty'

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.


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
    #something else

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


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