%s:格式化输出文字或数字
%d:格式化输出数字
format:格式化输出数字或文字
# 格式化输出:
# 1、%s、%d两种当输出的字符串中没有%时优先(%s、%d)
# 2、format() 格式化输出 当字符串出现多个%时优先用format()
# format()语法:"xx{}x".format(参数)
# url = "https://search.51job.com/list/040000,000000,0000,00,9,99,"
# "%25E4%25BA%25BA%25E4%25BA%258B%25E4%25B8%25BB%25E7%25AE%25A1,2,{}"
# ".html?lang=c&stype=&postchannel=0000&workyear=99&cotype=99°reefrom=99&jobterm=99&companysize=99"
# "&providesalary=99&lonlat=0%2C0&radius=-1&ord_field=0&confirmdate=9&fromType=&dibiaoid=0&address=&line=&specialarea=00&from=&welfare=".format(i) # 应该用format
# url1 = "https://movie.douban.com/top250?start=%s&filter=" % (i*25) # 用%s
>>>"{} {}".format("hello", "world") 输出结果:
网站名:菜鸟教程, 地址 www.runoob.com
网站名:菜鸟教程, 地址 www.runoob.com
网站名:菜鸟教程, 地址 www.runoob.com