Question -
Answer -
num = eval (raw_input (“Enter an integer from 1 to 5:”))
if num < 6 :
for i in range (1, num + 1):
for j in range (num-i, 0,-1):
print (” “)
for j in range (i, 0, -1):
print (j)
for j in range (2, i+1):
print (j)
print (” “)
else :
print (“The number entered is greater than 5”)
Output :