简体   繁体   中英

Need help quickly, in printing horizontally

  • 我想要一个图表也看起来像这样本质上作为输出

use


star_progress = '*'
def progress():
    for p in range(4): # you added one extra
        print(star_progress, end="\t\t\t", sep="")
   
# you cant call any function you write without defining it first  
        
print("Progress",end = '  ')
print("Trailing",end = '  ')
print("Retriever",end = '  ')
print("Excluded")
progress()

Just add end=' ' in the asterisk printing

#Function for Trailing asterisk

star_trailing= '*'
def trailing():
    for p in range(5):
        print(star_trailing, end='  ')

#input
print("progress",end = '  ')
print("Trailing",end = '  ')
print("Retriever",end = '  ')
print("Excluded")
progress()
trailing()

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM