iT邦幫忙

2018 iT 邦幫忙鐵人賽
DAY 2
0
AI & Machine Learning

tensorflow python系列 第 2

DAY2 Python安裝及簡單語法介紹

因為後續經常使用到python 所以我第2天會進行一些python的簡單教學!!

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)

0
1
2
3
4

(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也是再這個網頁學習的


上一篇
DAY1 前言
下一篇
DAY3 jupyter notebook
系列文
tensorflow python30
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言