python编程:从入门到实践 第七章

message=input("This is prompt:")
print(message)

str="this is a str"
name=input(str)
print(name)

unuser=['alice','brian','candace']
conuser=[]

while unuser:
    conuser.append(unuser[0])
    unuser.pop(0)

for i in conuser:
    print(i)

pets=['alice','brian','candaceo','sadaswrt','gfgofg','envsdd','oaa']

flag=0
for animal in pets:
    while 'o' in animal:    #查看单词中是否有‘o’
        flag=1
        break
    if flag:
        pets.remove(animal)
    flag=0
print(pets)




猜你喜欢

转载自blog.csdn.net/Big_Study_Father/article/details/89183994