1. def getsuff(s): tmp = s.split('.') if len(tmp) == 1: return None return tmp[-1] print getsuff('abc.de.f') print getsuff('abc de f') 2. def nrowcol(m): nr = len(m) nc = len(m[0]) return nr,nc a = [[5,1],[12,8],[13,88]] print nrowcol(a) # prints (3,2) 3. def bigsum(x): tot = 0 for i in x: if type(i) is list: tot += bigsum(i) else: tot += i return tot a = [5,12,13] b = [2,a] c = [3,[8,a,b]] d = [[8,a,b],b,1] print bigsum(a) print bigsum(b) print bigsum(c) print bigsum(d)