[Python] Program in Python for alphabets in pattern

Discussão em 'Python' iniciado por Stack, Fevereiro 17, 2025.

  1. Stack

    Stack Membro Participativo

    I have written this program:

    for i in range(1,6):
    for j in range(65,65+i):
    a = chr(j)
    print (a)
    print


    I want to print a pattern as follows:

    A
    A B
    A B C
    A B C D
    A B C D E


    but i am not getting the desired output

    i am getting

    A

    A
    B

    A
    B
    C

    A
    B
    C
    D

    A
    B
    C
    D
    E

    Continue reading...

Compartilhe esta Página