Python adding machine
Without actually code-golfing, there are still a few shortenings possible:

def ask(n):
    return float(input("Give %s number " % n))

ans = ask("first") + ask("second")
print(int(ans) if not ans % 1 else ans)


This uses a function for asking for the numbers, does not store the intermediate values, uses a ternary expression for printing and the fact that zero evaluates to False.



If you actually want it as small as possible (in bytes), this is a start, but can probably be golfed down a lot further (e.g. by encoding the strings):

a=lambda n:float(input("Give %s number "%n))
r=a("first")+a("second")
print((int(r),r)[r%1&gt;0])


Have a look at the tips for golfing in python.

If you also want to forego the interface:

r=sum(float(input())for _ in"_"*2)
print((int(r),r)[r%1&gt;0])