2015FALL 40123210 CPB 作業

2015 計算機程式 作業17

以下為作業17內容

利用 iframe 嵌入投影片:

作業17投影片

Jupyter notebook 檔案內容:

In [1]:
def sum10(x):
    sum = 0
    for i in range(1, x+1):
        sum = sum + i
    return sum
print(sum10(5),sum10(15))
15 120
In [2]:
def sum10(x):
    sum = 0
    for i in range(1, x+1):
        sum = sum + i
    return sum

y = sum10(5)
z = sum10(15)

print(y,z)
15 120
In [3]:
import random

def sum10(x):
    sum = 0
    for i in range(1, x+1):
        sum = sum + i
    return sum

y = sum10(10)
z = sum10(30)

print(y,z)

print(random.random())
55 465
0.136607961848912
In [ ]:
 

w17_2015_01_08 from 40123210 on Vimeo.

Comments