doctest docstring å ã«æ¸ãããå¡ä¾ã¨ãã¦ä½¿ããã 使ãæ¹ doctest ã import ããdocstring å ã§ä»¥ä¸ã®ããã«æ¸ããdoctest.testmod() ãå¼ã¶ãå®è¡ããé㯠python ${ãã¡ã¤ã«å}.py -v ã¨ããã ãµã³ãã«ã³ã¼ã # -*- coding: utf-8 -*- import doctest def twice(n): """ å¼æ°ã 2 åãã¦è¿ãé¢æ° >>> twice(8) 16 >>> twice(1850923) 3701846 """ return n * 2 if __name__ == "__main__": doctest.testmod()
{{#tags}}- {{label}}
{{/tags}}