Mega Code Archive

 
Categories / Python / String
 

Demonstrates the len() function and the in operator

message = "this is a test" print "\nThe length of your message is:", len(message) print "\nThe most common letter in the English language, 'e',", if "e" in message:     print "is in your message." else:     print "is not in your message."