我不断收到一条错误消息:TypeError: unsupported operand type(s) for *: 'dict' and 'float' 我已经将它更改为浮点数,但它不起作用。请指教!
job = {'fireman': 42600, 'librarian': 35000, 'clerk': 23000}
salary = float(job * 1.05 ** years_of_service)
return salary
...
这是解决方法,还是有更简单的方法?
谢谢!