Pyg Latin EMT1111

For this part is Pig Latin, for the first slide, it will tell us to print “Pig Latin” and the end result will be Pig Latin. The next slide, what it wants us to do is type raw_input:(“Enter a word:”) and we assign it to a variable which will be called original. Raw_input allows us to generate the input within it. Now, we input the if statement and with the if statement we type in len(original) is greater than 0 and we have to put : at the end of the if statement because if we don’t we will get a error. We then put print original and then we add an else statement. When we type in an answer that is greater than 0 the result will print, but it the answer is less than 0 it will give us the word empty. If the first statement doesn’t work then it goes to the next statement. In the next slide, we add in the method .isalpha() which will make the statement false and the result will be empty. Now we move onto to another slide which we will assign the variable pyg to ‘ay’. We use our previous code and we add pyg = ‘ay’ at the first line of the code.