Python add elements to a list

mylist = ["The","earth"]
mylist.insert(0,"Yes")
mylist = ["Yes","The","earth"]

mylist.append(["a","true"])
mylist = ["The","earth",["a","true"]]

mylist.extend(["a"])
mylist = ["The","earth","a"]

mylist = mylist + ["sure"]
mylist = ["The","earth","sure"]

mylist += ["."]
mylist =["The","earth","."]

你可能感兴趣的:(Python add elements to a list)