Homework Solution

Scripts

Problems to be Submitted (20 points)

  1. (10 points)

    name = input('What is your name? ')
    print('Hello ', name + '!')           # concatenate exclamation point

  2. (10 points)

    print('I will compute the hypotenuse of a right triangle.')
    print('But first, you must tell me the lengths of the legs.')
    a = float(input('What is the length of the first leg? '))
    b = float(input('What is the length of the second leg? '))
    c = (a**2 + b**2) ** 0.5
    print('The length of the hypotenuse is', str(c) + '.')


Last modified: Saturday, 08 September 2018