Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- verse = """
- The wheels on the bus go round and round,
- round and round, round and round,
- The wheels on the bus go round and round,
- All day long.
- """
- #words_of_verse = verse.split(' ') #Convert string to list
- words_of_verses = verse #Create duplicate string
- print(verse)
- nouns = ['wheels','horns', 'wipers', 'people']
- verbs = ['round and round','beep, beep, beep', 'swish, swish, swish', 'up and down']
- for i in range (0,len(nouns)):
- words_of_verses = words_of_verses.replace(nouns[i],nouns[i+1])
- print('i = ' + str(i))
- eachword = words_of_verses[i]
- print('eachword =' + words_of_verses[i])
- words_of_verses = words_of_verses.replace(verbs[i],verbs[i+1]) #Choose one name from list
- print(words_of_verses, '\n')
Add Comment
Please, Sign In to add comment