pythonfunctionloopssymbolswing-ide

How to print symbols vertically in python?


I just want to print a symbol a certain amount of times vertically.

def draw_symbol():
        print()
        symbol = ""
        for num in range(8):
            symbol += "*"        
        print(symbol)
        return

    draw_row()

The output is "*******" but it is supposed to be vertical.


Solution

  • def draw_symbol():
        for num in range(8):
            print("*")
        return
    draw_symbol()
    

    would result in:

    *
    *
    *
    *
    *
    *
    *
    *