Answer to Question #319871 in Python for Gaya

Question #319871

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.

1
Expert's answer
2022-03-29T16:48:58-0400
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())

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS