[Python] How to fix Python doesn't print all my string

Discussão em 'Python' iniciado por Stack, Abril 25, 2025.

  1. Stack

    Stack Membro Participativo

    I write some code, I want to print everything, but in one place the last character is not printed

    a = input("Input Text\n")
    b = []
    i = 0
    while i < len(a):
    b.append(a[0:i])
    i = i+1

    for c in b:
    print(c)
    temp = ''
    for i in range(-1, -len(b), -1):
    temp = b
    print(temp)


    Example:

    input text = 'abc', it will print this


    a, ab, ab, a
    ​

    Continue reading...

Compartilhe esta Página