#练习,把所有以a开头的单词改为以b开头的单词 lst1=['apple','abrupt','boy','beyonce','cindy'] i=0 b=len(lst1) while i<b: if lst1[i].startswith("a"): lst1[i]=lst1[i].replace("a","b") i=i+1 print(lst1)