try: a= input('Podaj a= ') b= input('Podaj b= ') print 'iloraz wynosi: ', a/b except: 'Niepoprawne dane'