asks ts out the first letter of each word in the sen xample of expected behaviour: ease type in a sentence: Humpty Dumpty sa

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter5: Control Structures Ii (repetition)
Section: Chapter Questions
Problem 27PE
icon
Related questions
Question

Can you use Python programming language to to this question?

Thanks

Please write a program which asks the user to type in a sentence. The program then
prints out the first letter of each word in the sentence, each letter on a separate line.
An example of expected behaviour:
Please type in a sentence: Humpty Dumpty sat on a wall
H
D
S
ο
a
W
1
# Write your solution here
Sample output
Transcribed Image Text:Please write a program which asks the user to type in a sentence. The program then prints out the first letter of each word in the sentence, each letter on a separate line. An example of expected behaviour: Please type in a sentence: Humpty Dumpty sat on a wall H D S ο a W 1 # Write your solution here Sample output
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Follow-up Questions
Read through expert solutions to related follow-up questions below.
Follow-up Question

Hello...Its not correct...

Please write a program which asks the user to type in a sentence. The program then
prints out the first letter of each word in the sentence, each letter on a separate line.
An example of expected behaviour:
Please type in a sentence: Humpty Dumpty sat on a wall
Н
HDS or W
a
1
2
3
4
5
6
7
8
9
10
11
RUN
my_str = 'Humpty Dumpty sat on a wall'
my_list = [word [0] for word in my str.split()]
for word in my_list:
Print (word)
TEST
Test Results
Show all
Reset
Sample output
0%
Need help?
FAIL: Python Editor Test: test_longer_sentences
Make sure that the execution of the program works with the input
Once upon a time, a mouse, a bird, and a sausage, entered into partnership and
set up house together.
Close
Submit
Transcribed Image Text:Please write a program which asks the user to type in a sentence. The program then prints out the first letter of each word in the sentence, each letter on a separate line. An example of expected behaviour: Please type in a sentence: Humpty Dumpty sat on a wall Н HDS or W a 1 2 3 4 5 6 7 8 9 10 11 RUN my_str = 'Humpty Dumpty sat on a wall' my_list = [word [0] for word in my str.split()] for word in my_list: Print (word) TEST Test Results Show all Reset Sample output 0% Need help? FAIL: Python Editor Test: test_longer_sentences Make sure that the execution of the program works with the input Once upon a time, a mouse, a bird, and a sausage, entered into partnership and set up house together. Close Submit
Solution
Bartleby Expert
SEE SOLUTION
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning