¤j®a¦n, ¥Ø«e¥¿¦b¦Û¾Çpython,¤U±ªº½d¨Ò1«Ü¦n²z¸Ñ
¦ý½d¨Ò2ªºµ²ªG½Ö¯àÀ°¦£¸ÑÄÀ¤@¤U¬°¦óµ²ªG¤£¬O§Ú©Ò·Qªº
{ 0+0*0 , 1+1*1 , 2+2*2.....9+9*9........} = {0, 2, 6, 12, 20, 30, 42, 56, 72.....90}
EX.1
testDic = {i: i * i for i in range(10)}
print(testDic)
ANS: {0: 0, 1: 1, 2: 4, 3: 9, 4: 16, 5: 25, 6: 36, 7: 49, 8: 64, 9: 81}
EX.2
testDxc = {i+ i * i for i in range(10)}
print(testDxc)
ANS: {0, 2, 6, 72, 42, 12, 20, 56, 90, 30}
ÁÂÁÂ |