Skip to content

Instantly share code, notes, and snippets.

@MichelleDalalJian
Created October 7, 2017 12:38
Show Gist options
  • Save MichelleDalalJian/061b4c2d8c7af108d520038c13a69f3b to your computer and use it in GitHub Desktop.
Save MichelleDalalJian/061b4c2d8c7af108d520038c13a69f3b to your computer and use it in GitHub Desktop.
2.3 Write a program to prompt the user for hours and rate per hour using input to compute gross pay. Use 35 hours and a rate of 2.75 per hour to test the program (the pay should be 96.25). You should use input to read a string and float() to convert the string to a number. Do not worry about error checking or bad user data.
xh = input("Enter Hours:")
xr = input("Enter Rate:")
xp = float(xh)*float(xr)
print("Pay:",xp)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment