Lesson 01/11 – Break It Down
[code lang=”python”]
[/code]
Lesson 02/11 – Ahoy! (or Should I Say Ahoyay!)
[code lang=”python”]
print ("Welcome to the English to Pig Latin translator!")
[/code]
Lesson 03/11 – Input!
[code lang=”python”]
print ("Welcome to the English to Pig Latin translator!")
original = raw_input(‘Please digit a word here’)
[/code]
Lesson 04/11 – Check Yourself!
[code lang=”python”]
print ("Welcome to the English to Pig Latin translator!")
original = raw_input(‘Please digit a word here’)
if original == "":
print ("empty")
else:
print (original)
[/code]
Lesson 05/11 – Check Yourself… Some More
[code lang=”python”]
print ("Welcome to the English to Pig Latin translator!")
original = raw_input(‘Please digit a word here’)
if original.isalpha():
print (original)
else:
print ("empty")
[/code]
Lesson 06/11 – Pop Quiz!
[code lang=”python”]
print ("Welcome to the English to Pig Latin translator!")
original = raw_input(‘Please digit a word here’)
if original.isalpha():
print (original)
else:
print ("empty")
[/code]
Lesson 07/11 – Ay B C
[code lang=”python”]
pyg = "ay"
[/code]
Lesson 08/11 – Word Up
[code lang=”python”]
pyg = ‘ay’
original = raw_input(‘Enter a word:’)
if len(original) > 0 and original.isalpha():
print original
word = original.lower()
first = word[0]
else:
print ’empty’
[/code]
Lesson 09/11 – Move it on Back
[code lang=”python”]
pyg = ‘ay’
original = raw_input(‘Enter a word:’)
if len(original) > 0 and original.isalpha():
word = original.lower()
first = word[0]
if first == "a" or first == "e" or first == "i" or first == "o" or first == "u":
new_word = word + pyg
print new_word
else:
print "consonant"
else:
print ’empty’
[/code]
Lesson 10/11 – Ending Up
[code lang=”python”]
pyg = ‘ay’
original = raw_input(‘Enter a word:’)
if len(original) > 0 and original.isalpha():
word = original.lower()
first = word[0]
if first == "a" or first == "e" or first == "i" or first == "o" or first == "u":
new_word = word + pyg
print new_word
else:
new_word = word[1:] + first + pyg
print new_word
else:
print ’empty’
[/code]
Lesson 11/11 – Testing, Testing, is This Thing On?
[code lang=”python”]
pyg = ‘ay’
original = raw_input(‘Enter a word:’)
if len(original) > 0 and original.isalpha():
word = original.lower()
first = word[0]
if first == "a" or first == "e" or first == "i" or first == "o" or first == "u":
new_word = word + pyg
print new_word
else:
new_word = word[1:] + first + pyg
print new_word
else:
print ’empty’
[/code]
These are outdated.