J
Jiewei Huang
Hi all,
I'm currently stuck at this question on
Writing a function len_str that takes a string as an argument and returns a pair consisting of the length of the string and the string itself.
Example: len_str('Meaning of life') should return the tuple (15, 'Meaning of life').
I can only think of this :
len_str = ('welcome to life' )
print (len(len_str,), len_str)
However that not an correct answer I need to make a def len_str but I can't seen to get it right.
I'm currently stuck at this question on
Writing a function len_str that takes a string as an argument and returns a pair consisting of the length of the string and the string itself.
Example: len_str('Meaning of life') should return the tuple (15, 'Meaning of life').
I can only think of this :
len_str = ('welcome to life' )
print (len(len_str,), len_str)
However that not an correct answer I need to make a def len_str but I can't seen to get it right.