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.
#Replace all ______ with rjust, ljust or center. thickness=int(input())#Thismustbeanoddnumberc='H'# Top Coneforiinrange(thickness):print((c*i).rjust(thickness-1)+c+(c*i).ljust(thickness-1))# Top Pillarsforiinrange(thickness+1):print((c*thickness).center(thickness*2)+(c*thickness).center(thickness*6))# Middle Beltforiinrange((thickness+1)// 2):print((c*thickness*5).center(thickness*6))# Bottom Pillarsforiinrange(thickness+1):print((c*thickness).center(thickness*2)+(c*thickness).center(thickness*6))# Bottom Coneforiinrange(thickness):print(((c*(thickness-i-1)).rjust(thickness)+c+(c*(thickness-i-1)).ljust(thickness)).rjust(thickness*6))
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 →