The string format of Python

Source: Internet
Author: User

Right triangle of Chinese character graphics

Describe

Get a Chinese character entered by the user, output as a shape (here with asterisks instead of Chinese characters):

Requirements arranged neatly, note: The output of the above graphic, blank space can not be used, to use Chinese space, the Chinese space corresponding to the Unicode code 12288.

Input format

A Chinese character

Output format

As shown in the formatting effect.

Input Output sample

 

Input

Output

Example 1

And

And

And AND and

And and and and and

And and and and and and and and

And and and and and and and and

Program code:

#coding =GBK

h = input ("Please enter the Chinese characters you want:")

For I in Range (1,6):

Print ("{0:{1}>9}". Format (h* (2*i-1), Chr (12288)))

The string format of Python

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.