“在帐户中的帐户”循环中收到无效的语法错误,为什么?
请帮助,我已经为此苦苦挣扎
app.send(
functions.channels.InviteToChannel(
channel=app.resolve_peer("xyz123"),
users=[
for account in accounts:
app.resolve_peer(accounts)
]
)
)
答案 0 :(得分:2)
您要使用list comprehension:
app.send(
functions.channels.InviteToChannel(
channel=app.resolve_peer("xyz123"),
users=[
app.resolve_peer(account) for account in accounts
]
)
)