#!/usr/bin/python # a persons raise can be determined by taking 1% of their salary and multiplying by their Review Rating # Salary = raw_input("enter salary") // I took these lines out because I felt you should def the functions before # print ............ # rating = raw_input("enter rating (0-5)") .......... # print -----> having the program run and ask for input // def calcRaiseAmount(rating): # global Salary #This turns "Salary" into a "Global" Variable that can be modified from Anywhere.(we don't need this line) # Salary = float(Salary) * .01 // I commented out this line to see if it could dissapear// RaiseAmount = float(Salary) * 0.01 *( float(rating)) # I added the 1% here and made the entire line an algebra problem // return RaiseAmount Salary = raw_input("enter salary ") # // I added a few tab spaces to keep the number from crashing into the name // print (Salary) # Hmm There needs to be a way to display on the input box what you are typing rating = raw_input("enter rating (0-5) ") # because it is not defined and you could forget what screen you're on... print (rating) # RaiseAmount = calcRaiseAmount(rating) # I'm not sure why we are re-defining RaiseAmount here // NewSalary = float(Salary) + float(RaiseAmount) # // I'm Not familiar with 'float' function print("Your New Salary is ${:,}".format(NewSalary)) # or 'format' //
Run
Reset
Share
Import
Link
Embed
Language▼
English
中文
Python Fiddle
Python Cloud IDE
Follow @python_fiddle
Browser Version Not Supported
Due to Python Fiddle's reliance on advanced JavaScript techniques, older browsers might have problems running it correctly. Please download the latest version of your favourite browser.
Chrome 10+
Firefox 4+
Safari 5+
IE 10+
Let me try anyway!
url:
Go
Python Snippet
Stackoverflow Question