Aug-01-2019, 08:23 PM
If function doesn't return anything explicitly with return statement then it returns None (you can see it in your output: three lines printed and then None). In case of empty string function returns 'invalid entry' therefore there will be no None.
I would go for oneliner:
I would go for oneliner:
>>> s = 'Rivers' >>> ''.join(char*(2*(i-1)+2) for i, char in enumerate(s, start=1) if i % 2) 'RRvvvvvvrrrrrrrrrr'
I'm not 'in'-sane. Indeed, I am so far 'out' of sane that you appear a tiny blip on the distant coast of sanity. Bucky Katt, Get Fuzzy
Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.
Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.