python怎么在url后门添加数据

问题遇到的现象和发生背景
用代码块功能插入代码,请勿粘贴截图
我想要达到的结果
    for line in file:
        new_url=line+'/plus/download.php?link=aHR0cHM6Ly93d3cuYmFpZHUuY29t&open=1'
        print(new_url.rstrip())

这样打印的数据是两行

读文件读出的line后面有换行符,rstrip去掉。

    for line in file:
        new_url=line.rstrip()+'/plus/download.php?link=aHR0cHM6Ly93d3cuYmFpZHUuY29t&open=1'
        print(new_url)

有帮助的话采纳一下哦!

直接打印new_url不就行了吗

您好,我是有问必答小助手,您的问题已经有小伙伴帮您解答,感谢您对有问必答的支持与关注!
PS:问答VIP年卡 【限时加赠:IT技术图书免费领】,了解详情>>> https://vip.csdn.net/askvip?utm_source=1146287632