Python Forum
Beginner - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: Beginner (/thread-5622.html)



Beginner - willianramos - Oct-13-2017

Hi, I would like to know the error of this script.

salary = float(input("Enter your salary: "))
if salary > 2000:
gain = (salary + (salary * 0,10))
print("Your new salary is $%-6.2"%gain)


RE: Beginner - Lux - Oct-13-2017

Can you show what error message you are getting? And please use code tags around your code


RE: Beginner - willianramos - Oct-13-2017

##algorithm that reads a person's salary and performs an increase

salary = float(input("Enter your salary: "))
if salary > 2000:
gain = (salary + (salary * 0,10))
print("Your new salary is $%-6.2"%gain)

##Error message
Traceback (most recent call last):
File "C:\Users\Usuario\Desktop\Estatística\Python\Scripts(aula)\Twelve.py", line 3, in <module>
gain = (salary + (salary * 0,10))
TypeError: unsupported operand type(s) for +: 'float' and 'tuple'


RE: Beginner - Lux - Oct-13-2017

Did you mean to write 0.10 instead of 0,10? (period instead of comma)


RE: Beginner - willianramos - Oct-13-2017

(Oct-13-2017, 07:28 PM)Lux Wrote: Did you mean to write 0.10 instead of 0,10? (period instead of comma)

Yes, sorry for bothering with a little problem.