Hello,
I have this programm: def encapsulate(val, seq): if type(seq) == type(""): return str(val) if type(seq) == type([]): return [val] return (val,) def insert_in_middle(val, seq): middle = len(seq)/2 return seq[:middle] + encapsulate(val, seq) + seq[middle:] def make_empty(seq): """ >>> make_empty([1, 2, 3, 4]) [] >>> make_empty(('a', 'b', 'c')) () >>> make_empty("No, not me!") '' """ word2="" teller=0 if type(seq) == type([]): teller=0 while teller < len(seq): seq[teller]="" teller = teller + 1 elif type(seq) == type(()): tup2 = list (seq) while teller > tup2.len(): tup2[teller]="" teller = teller + 1 seq = tuple(tup2) else: seq = "" test = make_empty([1, 2, 3, 4]) print test But now I get None as output instead of [] Can anyone explain why that happens ? Roelof
_______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor