Q:

TypeError: unsupported operand type(s) for -: 'str' and 'int'

do not combine int with string !
Example:int + string = error
correct example: int + int = no error 
                 string + string = no error
1
#this is a int
Anmol = 1

#this is a str
Mom = "1"

Anmol + Mom
#if you add you get someting that looks like this
#TypeError: unsupported operand type(s) for -: 'str' and 'int'
#to fix do the following

Anmol + str(Mom)
2

New to Communities?

Join the community