+ 1
How to pass multiple user input to a function during runtime( dynamically) ?
4 Réponses
+ 1
Just use input() multiple times, storing the value given in a different variables each time, then call your function with your variables.
+ 1
catch the input in different variable and the supply those variable in function call
+ 1
what I need to know is how to store it dynamically into the list like we do in other programming language while using array so how can it be done in Python so it will be more dynamic as compared to the old one.
0
The correct answer is make a function like this and pass the list name
def f(list):
for I in list:
total+=I
print(total)
now declare the list and paas the list name in the function. as follows
l=[1,2,3,4]
f(l)