places= ["Home","In-n Out Burger", "John's house", "Santa Monica Pier", "Staples center", "LA Dodgers stadium", "Home"]
def placesCount(places):
multi_word = 0
count = 0
while True:
place = places[count]
if ' ' in place and place!='LA Dodgers stadium' **""" or anything that comes after LA dogers stadium"""** :
multi_word += 1
if '' in place and place!='LA Dodgers stadium' """ **or anything that comes after LA dogers stadium**""":
count += 1
print (count, "places to LA dodgers stadium"), print (multi_word)
placesCount(places)
在这种情况下,我基本上想知道当while循环到达列表()的某个元素时,如何阻止它添加到列表"LA Dodgers Stadium"
中。在到达列表的该元素后,它不应添加任何内容。