超入門的線上資源
再進入python 學習前,可以試著參考黑修斯的這篇文章<程式語言 | 程式語言入門線上學習資源>,內容有介紹CodeStudio,而CodeStudio是一個非常適合完全不懂程式語言,或是想學習第二種程式語言的好網站,不只可以學習程式的邏輯,更適合父母一同陪伴孩子從零一起學習。注意,此篇介紹的是python 2.7的編譯器,讀者可以選擇python 3 的編譯器選項,操作是一樣的。
兩種版本介紹
- Online Compilers and Interpreters 基本編譯器
- Advanced IDEs 進階編譯器
首先,到coodinggroud網站上,到Online Compilers and Interpreters (線上編譯器),選擇python,如下圖操作,進入網站後,往下拖曳。

到Online Compilers and Interpreters 的地方,繼續往下找,找到python


找到後,點擊進去,畫面如下:
讀者可以點擊 Execute 編譯程式,右邊的Result會出現Hello world字串。

接著你可以測試以下程式碼,會如下圖一樣。
# Hello World program in Python 2.7
print "Hello World!\n"
print 5+3
name = "hello"
print name

上述就是我們說的基礎編譯器版本,接著我們要介紹進階編譯器版本。
進階編譯器版本:
拉到頁面最下方,找到Advance IDEs,選擇python。

進入後,你會看到如下畫面,
你可以點下Execute執行,下方綠色框,就會出現hello world!。

接著,要如何像我們在電腦上使用命令視窗一樣呢?
直接在綠色框輸入 python,會就進入python的直譯模式。

輸入一段 print "hello",按下Enter鍵。
將會看到輸出 hello。


接著來實作一小段程式碼吧!!
請輸入
n = "hello"
n*3
按下Enter鍵。
會出現如最下圖的結果,出現"hellohellohello"


離開直譯模式的指令:
請輸入 exit() 或是 quit()。
注意:python 會辨識大小寫。
轉貼本文時,需註明來自黑修斯隨手札記原創作者 hughes chen(黑修斯),及附上原文連結,同時 禁止修改,禁止商業使用 。
2 留言
有辦法安裝模組執行嗎 不然意義不大
回覆刪除模組可以引入,但是無法安裝。
刪除不一定能即時回覆問題,有時間會盡量答覆。