[Python] Astrologers' star pattern in Python [closed]

Discussão em 'Python' iniciado por Stack, Maio 9, 2025.

  1. Stack

    Stack Membro Participativo

    Unable to print star pattern in python using Jupyter notebook. May be the issue with Jupyter Notebook or else. Please help and highlight the mistake.

    print("Astrologer's star")
    print("How many row of star you want?")
    n = int(input())
    print("Please input 1 if you want stars in ascending form or \nprint 0 if you want stars in descending form")
    oneORzero = bool(int(input()))

    if oneORzero == True:
    for i in range(1, n+1):
    for j in range(1, i+1):
    print("*")
    print("")

    else:
    for i in range(n, 0, -1):
    for j in range(1, i+1):
    print("*")
    print("")


    [​IMG]

    Continue reading...

Compartilhe esta Página