We're a place where coders share, stay up-to-date and grow their careers.
Python :
def count_sheep(n): for i in range(1,n+1): print(f"{i} sheep...", end=' ')
In one line :
count_sheep = lambda n : print(''.join([f"{i} sheep... " for i in range(1,n+1)]))
Python :
In one line :