【问题标题】:Store an output from an If condition in Python在 Python 中存储 If 条件的输出
【发布时间】:2022-10-17 16:58:40
【问题描述】:

我有这个简单的代码:

if tof == []:
        interacting = []

但我无法将交互存储到变量资源管理器中。如何存储交互?

【问题讨论】:

    标签: python


    【解决方案1】:

    你必须在外面创建变量,然后append() 一些东西!像这样:

    interacting = []
    if tof == []:
        interacting.append("some info")
    

    【讨论】:

      猜你喜欢
      • 2013-06-14
      • 1970-01-01
      • 1970-01-01
      • 2021-07-06
      • 2018-09-17
      • 1970-01-01
      • 2017-03-04
      • 2015-04-22
      • 1970-01-01
      相关资源
      最近更新 更多