urls=[
f"https://www.cnblogs.com/sitehome/p/{page}"
for page in range(1,5+1)
]
print(urls)
['https://www.cnblogs.com/sitehome/p/1', 'https://www.cnblogs.com/sitehome/p/2', 'https://www.cnblogs.com/sitehome/p/3', 'https://www.cnblogs.com/sitehome/p/4', 'https://www.cnblogs.com/sitehome/p/5']
相关文章
- 10-22for构建多网址列表简写