Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Username : Mario
- #Exercises: 2.2 - 2.5
- #Date : 01/12/2012
- #Exercise 2.2
- name = raw_input("Tell me your name.\n")
- print "Why hello there, " + name + "!"
- #Exercise 2.3
- workHours = raw_input("Enter the amount of hours: ")
- ratePerHours = raw_input("Enter how much do they paay you each hour: ")
- fltHours = float(workHours)
- fltRate = float(ratePerHours)
- totalPay = fltHours * fltRate
- print "The total payment is " + str(totalPay)
- #Exercise 2.4
- width = 17
- height = 12.0
- x = width / 2
- print x
- y = width / 2.0
- print y
- z = height / 3
- print z
- a = 1 + 2 * 5
- print a
- #Exercise 2.5
- celsius = float(raw_input("Enter a value in Celsius: "))
- fahrenheit = str(celsius * 9 / 5 + 32)
- print "The value in Fahrenheit is " + fahrenheit + " F."
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement