2016年12月21日 星期三

Python - Quick Note


  • Counters
      

  • Loop and remove(/insert) at same time for list (list移除不正確)
       

           ref. doc https://docs.python.org/3/tutorial/controlflow.html 4.2

  • int to str  → str(<數字>)
          
  • str to list → list("<文字>")
         
  • list to str →'', join(<List>)
     
  • reverse list → <List>.reverse()
     

  • reverse string [<begin>:<end>:<step>]
      

  • find max value for list→ max(<List>)
     

  • 確認List是否為空 → if not <List>
      

  • print不換行 → for 2.7 print("name"),   for 3.5 end=''
  • 不要空格workaround → sys.stdout.write('')
  • print int+str →需先將int轉換為str
      


  • print list in range → print A[3] to A[6] (not include A[7])
     
  • range with step
     

  • map, do something to all list member
     

  • operation to 2 list member in same place
       

  • zfill (only support str)
     

  • Binary to Decimal to Hexadecimal
    


  • lambda - simple function display
    

  • filter
    

  • reduce
   



  • Two list to dictionary
         Method 1:
     
         Method 2:
     

2016年6月1日 星期三

日文輸入法 - IME


  • Alt+shift  →切換成日文(切換輸入法)
  • alt+caps   →切換成片假名
  • ctrl+caps  →切換成平假
  • 促音         →重複最後一個  ex. さっき (sakki)
  • onaji      →々
  • kigou        →出現很多符號
  • ー             → 0旁邊的-
  • alt+~        →暫時切換成英文
  • ・              →/
  • 小字         →先打"L",大小寫均可