Python 3 . 6 . 2 ( v 3 . 6 . 2 : 5 fd 33 b 5 , Jul 8 2017 , 04 : 14 : 34 ) [ MSC v . 1900 32 bit ( Intel ) ] on win 32 Type " help ", " copyright ", " credits " or " license " for more information . >>> list ( range ( 6 ) ) [ 0 , 1 , 2 , 3 , 4 , 5 ] >>> list ( range ( 1 , 27 ) ) [ 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 11 , 12 , 13 , 14 , 15 , 16 , 17 , 18 , 19 , 20 , 21 , 22 , 23 , 24 , 25 , 26 ] >>> list ( range ( 1 , 10 , 3 ) ) [ 1 , 4 , 7 ] >>> str ( 3 ) ' 3 '>>> result = 구구단 ( 2 ) Traceback ( most recent call last ) : File "< stdin >", line 1 , in < module > NameError : name ' 구구단 ' is not defined >>> def 구구단 ( 변수 ) : ... print ( 변수 ) . ..>>> 구구단 ( 1 ) 1 >>> def 구구단 ( n ) : ... result = [ ] . .. result . append ( n * 1 ) . .. result . append ( n *......... 아니 잠깐 만 File "< stdin >", line 7 아니 잠깐 만 ^ SyntaxError : invalid syntax >>> def 구구단 ( n ) : ... result = [ ] . .. result . append ( n *% d 아 뭔가 이걸로 하 면 안 될라나 File "< stdin >", line 3 result . append ( n *% d 아 뭔가 이걸로 하 면 안 될라나 ^ SyntaxError : invalid syntax >>> def 구구단 ( n ) : ... result = [ ] . .. result . append ( n * 1 ) . .. result . append ( n * 2 ) . .. result . append ( n * 3 ) . .. result . append ( n * 4 ) . .. result . append ( n * 5 ) . .. result . append ( n * 6 ) . .. result . append ( n * 7 ) . .. result . append ( n * 8 ) . .. result . append ( n * 9 ) . .. return result . ..>>> print ( 구구단 ( 2 ) ) [ 2 , 4 , 6 , 8 , 10 , 12 , 14 , 16 , 18 ] >>> def 구구단 ( n ) : ... result = {}... result . append ( n *% d , % range ( 1 , 9 ) ) File "< stdin >", line 3 result . append ( n *% d , % range ( 1 , 9 ) ) ^ SyntaxError : invalid syntax >>> i = 1 >>> while i < 10 : ... print ( i ) . .. i = i + 1 . .. 123456789 >>> def 구구단 ( n ) : ... reult = [ ] . .. i = 1 . .. while i < 10 : ... result . append ( n * i ) . .. i = i + 1 . .. return result . ..>>> print ( 구구단 ( 2 ) ) Traceback ( most recent call last ) : File "< stdin >", line 1 , in < module > File "< stdin >", line 5 , in 구구단 NameError : name ' result ' is not defined >>> def 구구단 ( n ) : ... result = [ ] . .. while i < 10 : ... result . append ( n * i ) . .. i = i + 1 . .. return result . ..>>> print ( 구구단 ( 2 ) ) Traceback ( most recent call last ) : File "< stdin >", line 1 , in < module > File "< stdin >", line 3 , in 구구단 UnboundLocalError : local variable ' i ' referenced before assignment >>> def GUGUDAN ( n ) : ... result = [ ] . .. i = 1 . .. while i < 10 : ... result . append ( n * i ) . .. i = i + 1 . .. return result . ..>>> print ( GUGUDAN ( n ) ) Traceback ( most recent call last ) : File "< stdin >", line 1 , in < module > NameError : name ' n ' is not defined >>> print ( GuGu ( 3 ) ) [ 3 , 6 , 9 , 12 , 15 , 18 , 21 , 24 , 27 ] >>> print ( GuGu ( 2424 ) ) [ 2424 , 4848 , 7272 , 9696 , 12120 , 14544 , 16968 , 19392 , 21816 ] >>>