【问题标题】:In python how can we append run time reults to a list?在 python 中,我们如何将运行时结果附加到列表中?
【发布时间】:2013-10-25 15:36:24
【问题描述】:

如何为 python 斐波那契数列生成编写单元测试用例。我需要将生成的输出附加到一个列表中,然后必须将该列表与测试用例的示例列表进行比较。

【问题讨论】:

    标签: python


    【解决方案1】:

    在信息有限的情况下我能给出的最佳答案:

    result = []
    for each in run_time_results:
        result.append(each)
    

    【讨论】:

    • 这可以简化为result = []; result.extend(run_time_results)result = [i for i in run_time_results] 甚至result = list(run_time_results)
    • 我需要一个例子来为python中的斐波那契数列生成编写单元测试用例
    猜你喜欢
    • 1970-01-01
    • 2022-10-23
    • 2017-07-14
    • 2017-03-28
    • 2013-06-30
    • 1970-01-01
    • 2020-06-05
    • 1970-01-01
    • 2012-03-10
    相关资源
    最近更新 更多