repl.it
@hufeigopython/

Python 程式設計入門共學營作業任務七

Python

No description

fork
loading
Files
  • main.py
main.py
1
2
3
4
5
6
7
8
raw_log_file = '128.90.16.86,186.182.189.72,70.25.134.67,153.40.249.245, 58.246.211.25,128.90.16.86,186.182.189.72,170.25.134.67, 10.40.249.245,58.246.211.25'

# ' '取代',' ,再用空白分開
log_file = raw_log_file.replace(',', ' ').split(' ')

# 字串轉成集合
print(len(set(log_file)))