Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

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.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

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

would result in:

*
*
*
*
*
*
*
*
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading