Coding Practice - 20 Split the Sentence

 Split the Sentence

Given a list of N words, write a program to print each word in a line.
Input

The first line of input will contain space-separated words, denoting the elements of the list.
Output

The output should be N lines containing each word in a new line in the given order.

Explanation

For example, if the given sentence is the following.
Banana Apple Pomegranate Strawberry Grapes Orange

Your code should print each word in a new line. So the output should be
Banana
Apple
Pomegranate
Strawberry
Grapes
Orange
Sample Input 1
Banana Apple Pomegranate Strawberry Grapes Orange
Sample Output 1
Banana
Apple
Pomegranate
Strawberry
Grapes
Orange
Sample Input 2
Cricket Hockey Football Badminton Tennis Basketball Golf Volleyball Archery Boxing
Sample Output 2
Cricket
Hockey
Football
Badminton
Tennis
Basketball
Golf
Volleyball
Archery
Boxing



code:


a= input()
w= a.split()
for word in w:
    print(word)













Comments

Popular posts from this blog

CODING ASSIGNMENT 3 Library Management

CODING PRACTICE 11 Music Page

CCBP Static Website Coding Assignment 2 Solution | Yoga Page