[Solved] Python 3.7 new line and slicing [closed]


This will work. List splicing is what you’re after.

def yesterday():
    for i in range(1,len("yesterday")+1):
        print("yesterday"[:i])

yesterday()

solved Python 3.7 new line and slicing [closed]