Python Programming - Console Input/Output - Discussion
Discussion Forum : Console Input/Output - General Questions (Q.No. 68)
68.
How can you read a sentence from the console, find the length of each word, and print the result?
Answer: Option
Explanation:
To read a sentence from the console, find the length of each word, and print the result, use
sentence = input("Enter a sentence: "); print([len(word) for word in sentence.split()])
.
Discussion:
Be the first person to comment on this question !
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers