String concatenate TypeError: can only concatenate str (not "int") to str"

This should fix it:

salaries['John'] = str(int(salaries['John']) + 30)

You need to convert the salaries of John to an int add 30 and then convert it back to a string.

This will change salaries['John'] from 20 to 50


If you wanted to include the 30 you'd have to put something like str(30). That's why it's giving you that error cause 30 is an int and the rest are strings you can't combine strings and ints. Hope this helps