Exception has occurred: TypeError
unsupported operand type(s) for +: 'int' and 'str'
File "/home/QuartsPy/Desktop/Python Random/Missing.py", line 5, in main
finished_data = sum(data)
File "/home/QuartsPy/Desktop/Python Random/Missing.py", line 10, in <module>
main()
I keep getting this^^ error I am trying to make a missing number finder. So I would enter in input 1,3,4 and it should send 2 in the console because that is the missing number. This is my code:
def main():
data = input()
n = len(data)
total = (n + 1)*(n + 2)/2
finished_data = sum(data)
print(total - finished_data)
if __name__ == "__main__":
main()