9
我有變量N和W隨每次運行而變化。是否有可能做一些像下面?:Python:在Pylab標題中使用變量
pylab.title('Minimal Energy Configuration of' N 'Charges on Disc' 'W = 'W)
我有變量N和W隨每次運行而變化。是否有可能做一些像下面?:Python:在Pylab標題中使用變量
pylab.title('Minimal Energy Configuration of' N 'Charges on Disc' 'W = 'W)
我覺得你講的字符串插值像這樣:
pylab.title('Minimal Energy Configuration of %s Charges on Disc W = %s'%(N, W))