Python切片问题

1.请写一个函数,实现删除字符串当中的首尾空格,请用切片操作,不要使用strip()函数

2.有一个数列(1,2,3,6,……),第一项为1,第二项为2,第三项为前面两项的乘积,打印出前10项。

3.有一个集合L={'Jack':[90,80,60],'Machile':[80,60,30],'Bob':[80,70,90]},

请使用map分别计算每个同学的

(1)总成绩

(2)平均分


def str_strip_space(s):
    temp = s
    while temp[0] == " ":
        temp = temp[1:]
    while temp[-1] == " ":
        temp = temp[:-1]
    return temp


print("|"+str_strip_space("  abcdef    a  ")+"|")