set
-
Python基礎練習之set/dict練習
1.用戶輸入一個數字 打印每一位數字及其重復的次數 (1)字符串練習2用的方法 while True: num = input().strip().lstrip(‘0’) if num.isdigit(): break count = [0] * 10 for j in num: x = int(j) if count[x] == 0: count[x] =…
1.用戶輸入一個數字 打印每一位數字及其重復的次數 (1)字符串練習2用的方法 while True: num = input().strip().lstrip(‘0’) if num.isdigit(): break count = [0] * 10 for j in num: x = int(j) if count[x] == 0: count[x] =…