How can I make a python3 program not crash if it tries to add a string and a number together
Question: Source code

* * *
    
    
    import sys
    hi = input("Input a number ")
    yo = input("Input a second number ")
    
    total = int(hi) + int(yo)
    
    def convertStr(s):
    
            try:
                ret = int(s)
                print(int(total))
    
            except ValueError:
    
                ret = str(total)
                print("There was an error")
    
    
    convertStr(total)
    

How can I make it so that the python can add two inputs together but not crash
when I put a string in one of the values?


Answer: You can use your function `convertStr(s)` on input `hi` and `yo`. If input is
not a number then ask again for input.

