标题: 求助python遍历问题 [打印本页] 作者: baibaoxuebao 时间: 2020-11-17 13:28 标题: 求助python遍历问题 a = [1,2,3,4,5,6]
b = [1,2,3,4,5,6]
a*100 + b*100 = 600
怎么遍历出a和b 正确的答案??? 作者: crossin先生 时间: 2020-11-17 13:34
for x in a:
for y in b:
if x*100 + y*100 == 600:
print(x, y) 作者: baibaoxuebao 时间: 2020-11-17 13:38
crossin先生 发表于 2020-11-17 13:34
for x in a:
for y in b:
if x*100 + y*100 == 600:
import tushare as ts
pro = ts.pro_api("1356a4b253109f02818831da0ba821d9129b961b65152c41ceef5e7a")
df = pro.daily(trade_date='20201116', fields='close')
print(df)
for i in range(0, 4059):
for y in range(0, 4059):
if df['close']*100+df['close'][y]*100 == 5334:
print(df['close'], df['close'][y])
break作者: baibaoxuebao 时间: 2020-11-17 13:38
crossin先生 发表于 2020-11-17 13:34
for x in a:
for y in b:
if x*100 + y*100 == 600: