In a game a random sentence was chosen and the players were divided into different groups. Each group was given a word from the sentence, making sure that the number of groups formed is equal to number of words in sentence. Number of players in each group corresponds to number of letters in the word given to them.
They were made to sit in a line in the order of the letters in the word. When game starts, the player should rotate left such that when sat in a line., the word formed should start with a vowel. Find final sentence formed.
Note: if no vowels, player will not rotate
Input: A boy carrying bag slipped on floor
Output: A oyb arryingc agb ippedsl on oorfl
Need correct output sir.
alf = "BCDFGHJKLMNPQRSTVWXZbcdfghjklmnpqrstvwxz"
s_arr = input("> ").split()
res = ""
for i in s_arr:
for j in i:
if j in alf:
i = i[1:] + i[0]
else:
break
res += i + " "
print(res.strip())
Comments
Leave a comment