from __future__ import print_function def f(x): return x**0.5 def wykres(a, b, func): for y in xrange(b, 0, -1): for x in xrange(a): if abs(y-func(x))<0.5: print ('*', end='') else: print (' ', end='') print ('') wykres(20, 10, f)