Demonstrates the len() function and the in operator : String In « String « Python






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."

   
  








Related examples in the same category

1.Step through String ItemsStep through String Items
2.Is a character inside a stringIs a character inside a string