Put Y in their positions
for j in range ( n ) : NEW_LINE INDENT if ( j == i or j == n - k ) : NEW_LINE INDENT print ( ' Y ' , end = " " ) NEW_LINE DEDENT else : NEW_LINE INDENT print ( ' X ' , end = " " ) NEW_LINE DEDENT DEDENT break NEW_LINE k -= ( n - i - 1 ) NEW_LINE