最新消息:XAMPP默认安装之后是很不安全的,我们只需要点击左方菜单的 "安全"选项,按照向导操作即可完成安全设置。

Python安裝及簡單語法介紹

XAMPP下载 admin 830浏览 0评论
 python是一種強調代碼可讀性以及簡潔的語言

python並不使用大括號以及分號 而是使用縮排來作為程式的執行依據
安裝

ubuntu

$ sudo apt-get install python3.5

測試安裝是否成功

$ python3
Python 3.5.2 (default, Nov 23 2017, 16:37:01)
[GCC 5.4.0 20160609] on linux
Type “help”, “copyright”, “credits” or “license” for more information.
>>> print(“hello world”)
hello world
簡單語法介紹

1.print

print(“hello world!!”)

hello world!!
2.for….in

for i in range(5):
print(i)

(1)if….:

i=5
if i=5:
print(“12345”)
else:
print(“error”)

12345
(2)if….:

else:

i=6
if i=5:
print(“12345”)
else:
print(“error”)

error
更多語法資訊學習網站
codecademy

https://www.codecademy.com/

具有多種語言可以學習的網站

筆者的python也是再這個網頁學習的

转载请注明:XAMPP中文组官网 » Python安裝及簡單語法介紹

您必须 登录 才能发表评论!