fork download
  1. """
  2. Python 程式練習:
  3. 寫一程式讀入一整數(python用二的補數系統表示此整數),
  4. 計算此整數在該表示法下1的個數,
  5. 若是奇數個則列印odd parity 否則列印 even parity。
  6. (e.g 輸入 5 (bit pattern : 0...0101) 輸出 even parity)
  7. (required skills: while loop; (bit level 邏輯運算 & (AND), >> (shift right)。
  8. """
  9.  
  10. import uuid
  11. print(uuid.uuid4())
  12. print(uuid.uuid4())
  13.  
  14.  
  15.  
  16.  
Success #stdin #stdout 0.04s 10396KB
stdin
8
stdout
951cfd44-bb70-41cf-9435-097856b1257c
0452c19a-de0f-42e4-a837-a5993551e296