Python2.6ãã使ç¨å¯è½ãªstr.formaté¢æ°ãæ§æ¥ã®%å½¢å¼ã®æååãã©ã¼ãããããã好ã¾ããæ¸ãæ¹ã æ³¢æ¬å¼§ã§å²ã¾ãããã£ã¼ã«ãã«ãã©ã¡ã¼ã¿ãåãè¾¼ãã§æååãæå®ãããæ³¢æ¬å¼§èªä½ãæ±ãå ´åã¯äºéã«è¨è¿°ãã¦ã¨ã¹ã±ã¼ãããã{{, }} 詳細ã«ã¤ã㦠6.1.3. æ¸å¼æå®æååã®ææ³ ã¾ãPython3.6ãããã©ã¼ãããé¢æ°ã¨åçã®æ©è½ãã㤠ãã©ã¼ãããæ¸ã¿æååãªãã©ã«(f-string) ãå°å ¥ããã¾ãããâ»å¾è¿° åã込㿠>>> "A={0}.".format("John") #ã¤ã³ããã¯ã¹ãæå®ãã¦åã込㿠'A=John.' >>> "A={0}. B={1}".format("John", "Taro") 'A=John. B=Taro' # ãã¼ã¯ã¼ãå¼æ°ã§æå® >>> "A={ab}. B={cd}".format(ab="John", cd="Taro")
{{#tags}}- {{label}}
{{/tags}}