If you really want things to be a specific way. You can make your own types.
# if you really want to string + int # just make an override class MyString(str): def __add__(self, value): if isinstance(value, (int, float)): return MyString(str.__add__(self, str(value))) else: return MyString(str.__add__(self, value)) a = MyString('Hello') + 5 a = a + 7 print(a)
99 percent of computer problems exists between chair and keyboard.