You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
python直接运行不成功,debug后发现一些代码错误。
card type 为 11和8此处str格式但未加引号
以下为改正版本
def get_card_type_11(params, headers):
data = send_request(API_URL, params, headers)
#print(data)
if data is None:
return []
cards = data.get("cards", [])
card_type_11_info = []
for card in cards:
if card.get("card_type") == "11":
card_group = card.get("card_group", [])
for item in card_group:
if item.get("card_type") == "8":
info = {
"scheme": item.get("scheme"),
"title_sub": item.get("title_sub")
}
card_type_11_info.append(info)
#print(card_type_11_info)
return card_type_11_info
The text was updated successfully, but these errors were encountered:
python直接运行不成功,debug后发现一些代码错误。
card type 为 11和8此处str格式但未加引号
以下为改正版本
def get_card_type_11(params, headers):
data = send_request(API_URL, params, headers)
#print(data)
if data is None:
return []
cards = data.get("cards", [])
card_type_11_info = []
for card in cards:
if card.get("card_type") == "11":
card_group = card.get("card_group", [])
for item in card_group:
if item.get("card_type") == "8":
info = {
"scheme": item.get("scheme"),
"title_sub": item.get("title_sub")
}
card_type_11_info.append(info)
#print(card_type_11_info)
return card_type_11_info
The text was updated successfully, but these errors were encountered: