i'm new to python and started programming a simple calculator.
Now i want my calculator to recognize if the number entered is a float or int and answer accordingly.
so after they typed in the input for both numbers they want to add
n1 = (input("Geben Sie ihre erste Nummer ein: "))
n2 = (input("Geben Sie ihre zweite Nummer ein: "))
is there any way to check if the variables n1 and n2 are a float or integer and make a if statement for the right answer.
so for example if n1 = 2 and n2 = 4 the answer is 6, but if n1 = 2.3 and n2 = 4.2 the answer would be 6.5
I really hope you understand what i'm trying to say because i i certaintly don't.
Have a wonderful day.