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 can I print letters down below

I don’t know how can I program this.

needthis

I tried to do it but I know only opposite direction.

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

enter image description here

This is what I program porgram

>Solution :

You can implement your own backwards counter with range. zip that with the original string and you have your count.

>>> text = "ahoj"
>>> for i, c in zip(range(len(text),0,-1), text):
...     print(" "*i + c)
... 
    a
   h
  o
 j

Or, use enumerate to get indexes and do a little subtraction

>>> for i,c in enumerate(text):
...     print(" "*(len(text)-i) + c)
... 
    a
   h
  o
 j
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