The error message does not reflect what's wrong with your code. You're actually getting a TypeError when voyage_cout is called, because you're appending numbers (jours and depense_argent) to a string ville. You first have to convert both the numbers to strings (using the str function).