Why was I supposed to type pyg in this exercise?


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.

pyg = 'ay'
word = original.lower
original = raw_input('Enter a word:')
first = word [0]

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

the exercise

What exactly am I suppose to do for this exercise? Declare the variable inside the if statement?


nevermind I saw that you can declare a variable inside an if statement. did not know that.

Here is the working code:

pyg = 'ay'///why pyg?

original = raw_input('Enter a word:')

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


Hi @jacquesk,

Haha, there doesn’t seem to be a reason outside of the Codecademy people wanting to be punny.
Pig Latin ==> Python (.py) ==> pyg

Variables can be named anything you want but are expected to follow certain conventions (PEP 8 - Style Guide)

Hope this helps! :smile:


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