Python 入門資料
............................................................Keywords: Python, Introduction, Fundamental, Jupyter, ... .
............................................................
數字 a = 123
字串 a = '123'
............................................................
INPUT :讓使用者輸入資料,形態為字串。
..........
In[]:
a = input() # a from input data.
print ('a =', a)
Out[]:
123
a = 123
..........
In[]:
a = input('From your input data:') # a from input data.
print ('a =', a)
Out[]:
From your input data:156 a = 156
..........
# 四則運算
a = int(input()) # a from input data.
print('a is = ', a)
b = int(input()) # b from input data.
print('b is = ', b)
print ('a + b = ',a+b)
print ('a - b = ',a-b)
print ('a * b = ',a*b)
print ('a/b = ',a/b)
..........
# for loop
for i in range (0,10): # range is from 0 to n-1. print(i)
Out[] = 0123456789
............................................................
REFERENCE:
- [] DAY 01 python入門, ITHELP, 20181016, https://ithelp.ithome.com.tw/articles/10200558
- [] 一小時Python入門-part 1, KOPU, 20170118, https://kopu.chat/2017/01/18/一小時python入門-part-1/
............................................................
沒有留言:
張貼留言