Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

How do I do this Python programming exercise?

ii

Update:

I have to do this Python exercise for tomorrow although I don't know how to write it out:

Get the salary from a user. Then display their raise amount and the new salary. Assume the raise is 4.5%

2 Answers

Relevance
  • ?
    Lv 4
    4 years ago

    Python Programming Exercise

  • 6 years ago

    Hi Renata. Here is a solution for you:

    # get numeric input

    salary = float (input ("Enter salary: $"))

    # calculate raise amount

    raise_amount = 4.5 / 100 * salary

    # increase salary by raise amount

    salary += raise_amount

    # print raise amount and new salary

    print ("Raise amount = $%.2f" % raise_amount)

    print ("New salary = $%.2f" % salary)

Still have questions? Get your answers by asking now.