HNRS 299, Spring 2017

    Assignments

    Laboratory 1
    Due at the end of today's class

    Problem #1.
    Write a Python program (named hello.py) that asks for a user's name and where they are from. It should then greet the user and tell them their city is a nice place.

    A sample session might look like the following

      What is your name? Brenda
      Where are you from? Worcester
      Hello Brenda!
      I hear Worcester is a very nice place!

    Note: User input is underlined.

    Problem #2.
    Write a Python program (named converter.py) which asks for a length in feet, and then prints out the equivalent length in inches.
    A sample session might look like the following:

      Enter a length in feet: 12
      12 feet is the same as 144 inches.

    Note: User input is underlined.

    Problem #3.
    Write a Python program (named word.py) which inputs a string and prints the word, its length, the first letter and the last letter.

    A sample session might look like the following:

      Please enter a word: leopard
      You entered: leopard
      The length is 7
      The first letter is l
      The last letter is d

    Note: User input is underlined.

    What To Turn In.
    A printed listing of each lab program. To save paper, you may copy and paste all three programs into one document before printing. Place a line of dashes between the different programs. Be sure that your name is in the program prologue's comment section of EACH program.

    Reminder.
    Be sure to save a copy of each program, either by emailing it to yourself or saving it on your Google drive.
    You are responsible for keeping a copy of every program until the graded assignment is handed back.