--- description: Algorithm class with Jack image: https://hackmd.io/_uploads/BJj4o-z5Y.jpg --- # 211211 Class Notes - Jack ###### tags: `Jack` `Tutor` `Programming` `Mathematics` `BookMode` [TOC] ## LeetCode ### 13. Roman to Integer ![](https://hackmd.io/_uploads/BksvXzz5t.png) - [x] 把每個位數分開來(a) - [x] 判斷a是否大於4--------------1 - [x] (1)如果是,判斷是否等於九-----2 - [x] (2)如果是,打出相應符號 - [ ] (2)如果否,打出相應符號 - [ ] (1)如果否,判斷是否等於四-----3 - [ ] (3)如果是,打出相應符號 - [ ] (3)如果否,打出相應符號 ## Notes ### List: Append > Add new element to the list ```python= a = [] # start an empty list n = ['1', '2', '3', '4'] # read number of element in the list for i in range(len(n)): a.append(i[n]) # add it to the list print(a) ``` ### List: join > join all the thing in list ```python= a = [1, 2, 3] print(' '.join([str(i) for i in a])) ```