Advertisements
Advertisements
प्रश्न
Write a function, lenWords(STRING), that takes a string as an argument and returns a tuple containing length of each word of a string.
For example, if the string is "Come let us have some fun", the tuple will have (4, 3, 2, 4, 4, 3)
टीपा लिहा
Advertisements
उत्तर
def lenWords (STRING) :
T=()
L=STRING.split ()
for word in L:
length=len (word)
T=T+(length,)
return Tshaalaa.com
Reading from a Text File in Python
या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
