print測試
name="lixiaoming"
age=12
#單個
print ("你好%s" %name)
#多個
print ("名字是%s,年齡是%s" %(name,age))
#format 基本語法是經過 {} 和 : 來代替之前的 %
print ("名字是{myname},年齡是{myage}".format(myname="wangdali",myage=52))url
loggingorm
logging.info("url: {url}".format(url=url))form
logging.info("name:{name}".format(name='lixia'))
res="fail"
res1="suc"
logging.info("測試結果:{}".format("pass"))
logging.info("測試結果:{},{}".format(res,"res1"))語法