We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
f name =="main":
width = int(input())
actual_fig_width = 6*width
#left arrow
for i in range(width):
print(('H'*(2*i+1)).center(2*width))
#top pillars
for i in range(width+1):
print(('H'*width).center(2*width) + (('H'*width).rjust(actual_fig_width - 3*width + width//2)))
#middle horizontal pillar
for i in range(width//2 +1):
print(('H'*(width*5)).center(actual_fig_width))
#bottom pillars
for i in range(width+1):
print(('H'*width).center(2*width) + (('H'*width).rjust(actual_fig_width - 3*width + width//2)))
#bottom arrow
for i in range(width-1,-1,-1):
print((' '*2*width).center(actual_fig_width - 2*width) + ('H'*(2*i+1)).center(2*width))
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Text Alignment
You are viewing a single comment's thread. Return to all comments →
f name =="main": width = int(input()) actual_fig_width = 6*width