Count number of strings in python
First of all, I do realize that this is a really simple question and
please bear with me on this.
How, in python, can I get the numbers of strings? I am trying to do
something like this:
def func(input_strings):
# Make the input_strings iterable
if len(input_strings) == 1:
input_strings = (input_strings, )
# Do something
for input_string in input_strings:
analyze_string(input_string)
return
However, the len(str) returns the number of characters in the string and
wouldn't give me a "1".
I'd really appreciate your help!
No comments:
Post a Comment