請問該如何取得與上述一乙相同格式的一甲分組數列?
(一乙分組)
import
urllib.request
#導入urllib.request
target_url
=
"https://nfulist.herokuapp.com/?semester=1091&courseno=0776"
#設target_url = "網址"
cp1b
[]
#設cp1b=數列
for
line
in
urllib.request.urlopen(target_url):
#重複打開target_url的迴圈定義line
cp1b.append(
int
(line.decode(
'utf-8'
).rstrip()))
#把line重新編碼加進cp1b(數列) 註:rstrip()刪除字尾符號
print
(cp1b)
#印出cp1b
(一甲分組)
cp1a
#設cp1a=數列
cp1a.append(
#把line重新編碼加進cp1a(數列) 註:rstrip()刪除字尾符號
(cp1a)
#印出cp1a
Copyright © All rights reserved | This template is made with by Colorlib