LearnPy Hub
← Exceptions problems
Medium

Keep Asking

Lines of input arrive one at a time. Keep reading until you get a whole number, then print Got N after K tries.

Input

Several lines; one of them is an integer.

Output

One line.

Sample 1

Input
abc
x
42
Output
Got 42 after 3 tries

Sample 2

Input
7
Output
Got 7 after 1 tries
solution.py
Output appears here
Keep Asking · Python practice problem · LearnPy Hub