【发布时间】:2013-07-23 22:13:51
【问题描述】:
有没有更好的方法在 python3 中打印变量集?
在 PHP 中,我经常这样做:
echo "http://$username:$password@$server:$port"
但在 python 3 中,使用所有这些 + 输入看起来非常丑陋且更长
print('http://'+username+':'+password+'@'+server+':'+port)
在python中是否有类似“$”符号的东西?谢谢。
【问题讨论】: