20161209 - s40523143/2016fallcp_hw GitHub Wiki
<script type="text/python3">
from browser import document as doc
from browser import html
# 利用 document 根據 div 標註 id 設為 container 變數
container = doc['temperature']
def convTemp(event): mystring = "" cdegree = input("請輸入攝氏溫度:") fdegree = float(cdegree)*9/5 + 32 output_string = "攝氏 " + str(cdegree) + "度=華氏 " + str(fdegree) + "度" + html.BR() container <= output_string
doc['w13-1'].bind('click',convTemp) </script> 取攝氏溫度, 轉為華氏溫度