Persistent Systems Interview Question

In python, how do we restrict to get input only in integer?