Fixing a TypeError You typically fix a TypeError by casting your value(s) to the correct type. In general, to fix a TypeError, think carefully about the types of the values in the line that Python highlighted for you. The types are not compatible. So decide which types you really want, then use casts.