其他分享
首页 > 其他分享> > for构建多网址列表简写

for构建多网址列表简写

作者:互联网

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']

标签:sitehome,urls,www,cnblogs,列表,网址,https,简写,com
来源: https://www.cnblogs.com/chenxi188/p/15706905.html