我是比較新的蟒蛇和想要做的事,如:如果值x ==列表Ÿ任何值:蟒蛇
if value x == any value in list y:
write x
這將wihtin的功能操作,所以只有符合特定哪些解決方案標準將寫入csv,因爲它們會生成
我是比較新的蟒蛇和想要做的事,如:如果值x ==列表Ÿ任何值:蟒蛇
if value x == any value in list y:
write x
這將wihtin的功能操作,所以只有符合特定哪些解決方案標準將寫入csv,因爲它們會生成
>>> x = 8
>>> if x in (1, 2, 3, 5, 8, 13, 21, 34, 55):
print('x is an early Fibonacci number')
x is an early Fibonacci number
乾杯! – user1665220
這會適合您嗎?
x = somevalue
y = somelist
if x in y:
print x #not sure if this is what you mean by 'write'
'如果x在MYLIST: ' – joaquin