Using only string operations and basic math operations (you can't use specific method that does math operations), write a Python function to truncate a given floating point number to to given specific number of decimal places. Here you have to validate the input number for a floating pint number and if the user input an integer simply return that number itself as there is no decimal places to truncate. For example, for the number 9.9999 to truncate to 2 decimal places you would return 9.99.

def change(f, n):
f = str(f)
index = f.find('.')
result = f[:index+1+n]
return float(result)
print(change(9.9999, 2))
# Output: 9.99
Using only string operations and basic math operations (you can't use specific method that does math...