Your aged grandfather is tragically optimistic about Team GB's chances in the upcoming World Cup, and has enlisted you to help him make [Union Jack](https://en.wikipedia.org/wiki/Union_Jack) flags to decorate his house with. 
## Instructions
* Write a function which takes as a parameter a number which represents the dimensions of the flag. The flags will always be square, so the number 9 means you should make a flag measuring 9x9.
* It should return a *string* of the flag, with _'X' for the red/white lines and '-' for the blue background_. It should include newline characters so that it's not all on one line.
* For the sake of symmetry, treat odd and even numbers differently: odd number flags should have a central cross that is *only one 'X' thick*. Even number flags should have a central cross that is *two 'X's thick* (see examples below).
## Other points
* The smallest flag you can make without it looking silly is 7x7. If you get a number smaller than 7, simply _make the flag 7x7_.
* If you get a decimal, round it _UP to the next whole number_, e.g. 12.45 would mean making a flag that is 13x13.
* If you get something that's not a number at all, *return false*.
Translations and comments (and upvotes) welcome! 
![alt](http://i.imgur.com/1612YR3.jpg?1)
## Examples:
```python
union_jack(9) # (9 is odd, so the central cross is 1'X' thick)
"X---X---X
-X--X--X-
--X-X-X--
---XXX---
XXXXXXXXX
---XXX---
--X-X-X--
-X--X--X-
X---X---X"
union_jack(10) # (10 is even, so the central cross is 2 'X's thick)
'X---XX---X
-X--XX--X-
--X-XX-X--
---XXXX---
XXXXXXXXXX
XXXXXXXXXX
---XXXX---
--X-XX-X--
-X--XX--X-
X---XX---X
union_jack(1) # (the smallest possible flag is 7x7)
"X--X--X
-X-X-X-
--XXX--
XXXXXXX
--XXX--
-X-X-X-
X--X--X"
union_jack('string') #return false.
```
import math
def union_jack(n):
    if type(n) not in [int, float]:
        return False
    if n < 7: n = 7
    n = math.ceil(n)
    x = "-"*(n//2-1)+"XX"+ "-"*(n//2-1) if n%2 == 0 else "-"*(n//2) + "X" + "-"*(n//2)
    tmp = list(x)
    ans, n1 = [], n//2 if n%2 != 0 else n//2-1
    for i in range(n1):
        t = tmp[:]
        t[i] = 'X'
        t[-i-1] = 'X'
        ans.append(''.join(t))
    center = "X"*n if n%2 != 0 else "X"*n + '\n' + "X"*n
    return '\n'.join(ans + [center] + ans[::-1])
import math
def union_jack(n):
    if type(n) not in [int, float]:
        return False
    if n < 7: n = 7
    n = math.ceil(n)
    x = "-"*(n//2-1)+"XX"+ "-"*(n//2-1) if n%2 == 0 else "-"*(n//2) + "X" + "-"*(n//2)
    tmp = list(x)
    ans, n1 = [], n//2 if n%2 != 0 else n//2-1
    for i in range(n1):
        t = tmp[:]
        t[i] = 'X'
        t[-i-1] = 'X'
        ans.append(''.join(t))
    center = "X"*n if n%2 != 0 else "X"*n + '\n' + "X"*n
    return '\n'.join(ans + [center] + ans[::-1])