Demonstrates creating new strings with a for loop : String Declaration : String PYTHON examples


PYTHON examples » String » String Declaration »

 

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

   
  



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON examples

 Navioo String
» String Declaration