首页 > 解决方案 > Is there a way of addressing all the inputs in a program?

问题描述

Is there a way of addressing all the inputs in a program, for example, in an if statement or a for loop?

if (all inputs in the program) == int(all inputs in the program):
    print("your inputs are numbers")

and/or affecting them

for input in program:
    input = int(input)

标签: pythoninput

解决方案


我想如果您在程序中输入了一个主要功能并将所有 kwargs 传递给该方法,那么您可以循环它们。

main(**kwargs):
    function1()
    function2()

看到这个答案。如何在 Python 中循环遍历 **kwargs?

for key, value in kwargs.items():

推荐阅读