fork download
  1. # n = raw_input("Input n:")
  2. n = 9
  3. matrix = [[] for i in range(n)]
  4. for i in xrange(n):
  5. for j in xrange(n):
  6. if (i == j) or (i == (n-j-1)):
  7. matrix[i].append('*')
  8. else:
  9. matrix[i].append(' ')
  10. print ''.join(matrix[i])
Success #stdin #stdout 0.01s 9016KB
stdin
Standard input is empty
stdout
*       *
 *     * 
  *   *  
   * *   
    *    
   * *   
  *   *  
 *     * 
*       *