返回顶部

收藏

Demonstrates creating new strings with a for loop

更多
message = raw_input('Enter a message: ')
new_message = ''
VOWELS = 'aeiou'

print
for letter in message:
    if letter.lower() not in VOWELS:
        new_message += letter
        print 'A new string has been created:', new_message

print '\nYour message without vowels is:', new_message

标签:Python,String

收藏

0人收藏

支持

0

反对

0

发表评论