用冒号代替逗号的for循环到底有什么作用?我有一个列表和一个for循环,打印列表中的所有项目。 如果这真的很简单,我很抱歉,但我曾试图在网上找到答案,而且我对Python有点陌生。
import requests from bs4 import BeautifulSoup
page = requests.get("https://talksport.com/football/572055/") soup = BeautifulSoup(page.content, 'html.parser')
clubs = soup.findAll("h3")
for club in clubs[17:-2]:
# do something