base = input('What is the base?: ')
if '.' in base:
base = float(base)
else:
base = int(base)
Hello, what I was trying to do is to convert the string into either a float() or int() depending on what the user inputs. This is for a math formula, but I'm wondering if there is any other way to write the code.