Extra Exercises

  1. Predict what will print out from the following code.

If a line causes a run-time error, comment it out and see whether the rest of your predictions were correct.

  1. Avast, try this one, swabbies!

    Here’s a table of English to Pirate translations

    English Pirate
    sir matey
    hotel fleabag inn
    student swabbie
    boy matey
    madam proud beauty
    professor foul blaggart
    restaurant galley
    your yer
    excuse arr
    students swabbies
    are be
    lawyer foul blaggart
    the th’
    restroom head
    my me
    hello avast
    is be
    man matey

    Write a program that asks the user for a sentence in English and then translates that sentence to Pirate.

Next Section - Introduction: Accumulating Multiple Results In a Dictionary