Matrix with spiral increasing values This generates a square matrix with spiral inward increasing values. How can I reduce this code? 

Input Number = 3

Output 

1 2 3

8 9 4

7 6 5

import math
row=int(input("Input nomber := "))
lis=[[0 for i in range(0,row)]for j in range(0,row)]
y=row
a=1
c=0
z=0
x=1
k=1
f=row/2
f=math.ceil(f)
for b in range(0,f):
    if b==k:
        row=row-1
        x=x+1
        z=z+1
        k=k+1
    for c in range(z,row):      
        lis[b][c]=a
        a=a+1
    for d in range(x,row):
        lis[d][row-1]=a
        a=a+1
    for e in range(row-1,z,-1):
        lis[row-1][e-1]=a
        a=a+1
    for f in range(row-2,z,-1):
        lis[f][z]=a
        a=a+1
for i in range(0,y):
    print()
    for j in range(0,y):
        print(lis[i][j],end="\t")
Covering what others suggested (e.g. @Srivaths), please follow at least PEP8 Python PEP8

Then, put your code in some function.
Give meaningful names to variables. (What's a, c, x, z ... why are you not using b? )

You don't need import math -- instead of f=row/2
f=math.ceil(f), you can do f = row // 2 (assuming you use python 3). 

Note that you can solve the problem more generally, for m x n matrix, which you can initialize as:
matrix = [[0 for col in range(nCols)] for row in range(nRows)]
(see the answer from StackOverflow, provided by @OK).
This
 matrix = [[0] * m] * n, as pointed in the comments, won't work because of list references.

Now, we can also observe that you can fill the "outer rectangle", i.e. matrix[0][:] = range(1, nCols + 1); then, you can fill the rightmost column 

cnt += nCols
for row in range(1, nRows):
  matrix[row][rightIdx] = cnt
  cnt += 1
# Bottom row:
matrix[bottomIdx][leftIdx:] = reversed(range(cnt, cnt + nCols - 1) # might be off by 1;
# Complete first column

# Put this in a while loop;


This problem is similar -- once you have the matrix, print it in a spiral order:
Geeks for geeks website.

Also, you can check the solution of LeetCode Prob 54, but I would encourage you to try solving the problem yourself first.
Problem 54 Solution for Problem 54

And here is my solution to Problem 54, similar to Solution 2 (Leetcode Solution link above): My solution :)