Ok, so I am almost done with this question:
Write and test a function to take as input a list of strings (each of which
represents a number) and to return a list of numeric values. For example, if
the input to the function is [“67”, “8”,”75”] and return [67,8,75]. The input
should be as a parameter to the function.
here is the code I have written:
it works fine except for the fact that the input HAS to be as a string. Any help would be great because I am stumped.
Cheers
Write and test a function to take as input a list of strings (each of which
represents a number) and to return a list of numeric values. For example, if
the input to the function is [“67”, “8”,”75”] and return [67,8,75]. The input
should be as a parameter to the function.
here is the code I have written:
Code:
def func( num1, *numtuple):
print num1
for num in numtuple:
print num
Cheers
Comment