g = "golf" h = "hotel" print "%s,%s" %(g, h) def square(n): """Return the square of a number.""" square = n**2 print "%d squared is %d." % (n, squared) return squared
问题,
为什么%后面跟的不一样? %s中s是string的意思么? 那%d中d是什么意思哦?
(我是初学者,请多指教。)
g = "golf" h = "hotel" print "%s,%s" %(g, h) def square(n): """Return the square of a number.""" square = n**2 print "%d squared is %d." % (n, squared) return squared
问题,
为什么%后面跟的不一样? %s中s是string的意思么? 那%d中d是什么意思哦?
(我是初学者,请多指教。)
2014-09-19
举报