HI! some days ago i started learning Python! After understanding the basics i wrote this and while it could be useless spammy too long or generally could have been better it works and it feels good :p so here it is
def get(o, r):
f = 1
o = o + " a"
l = len(o)
w = 0
t = " "
w = 0
for f in range(l):
if " " == o[f]:
w = w + 1
if w == r:
return t
elif w != r:
t = " "
nextw = 1
else:
if " " != o[f]:
if nextw == 1:
nextw = 0
t = o[f]
elif nextw == 0:
t = t + o[f]