May-20-2017, 07:13 PM
(This post was last modified: May-20-2017, 07:22 PM by Dem_Prorammer.)
(Basically the task)
Write a program that displays n flags for a given number n from 1 to 9. The image of one flag has a size of 4 × 4 characters, and between two adjacent flags there is also an empty (from spaces) column. It is allowed to output an empty column after the last flag. Inside each flag, its number must be written - a number from 1 to n.
How the flag looks like:
Write a program that displays n flags for a given number n from 1 to 9. The image of one flag has a size of 4 × 4 characters, and between two adjacent flags there is also an empty (from spaces) column. It is allowed to output an empty column after the last flag. Inside each flag, its number must be written - a number from 1 to n.
How the flag looks like:
+___ |1 / |__\ |(My code)
n = int(input()) p_1="+___ " print(p_1*n, sep='') for i in range(1,n+1): print("|",i," / ",sep='') p_3="|__\\ " print(p_3*n) p_4="| " print(p_4*n ,'\n')So i having a problem when i enter a number, that's bigger than 1 something strange happens:
+___ +___ |1 / |2 / |__\ |__\ | |