リスト

result = list()
for i in range( 1, 5 ):
    result.append( sum_of_range( 1, ( 10 ** i ) ) )

print( result )

リストの内包表現

print( [ sum_of_range( 1, ( 10 ** i ) ) for i in range( 1, 5 ) ] )

SoftEng: Python/Prog/Practice/Extended/02/EP_001a/AdvancedTopics (last edited 2018-10-29 05:42:40 by TadashiIijima)