Skip to main content
 首页 » 编程设计

python之我的代码一直说 AttributeError : 'str' object has no attribute 'formart'

2024年12月31日8java哥

<分区>

salary = float(input("What is your salary?")) 
  if salary > 1250.00 : 
     new = salary*0.1 
    print("the increase was {}".formart(new)) 
if salary <= 1250.00: 
    new = salary*0.15 
    print("the increase was {}".formart(new)) 

它说

Traceback (most recent call last): 
  File "python", line 7, in <module> 
AttributeError: 'str' object has no attribute 'formart'