Python Programming - Len Function

Published

Introduction: Python Programming - Len Function

About: Occupation: Tech Support

Short Python program that used the "len" function to determine the number of characters in a string. Code is attached and below.

===========================================

print ("This program will determine the number of characters entered.")

StringEntered = input("Enter a word or sentence; spaces are ok: ")

print("The word or sentence that was entered was: ", StringEntered)

NumberOfCharacters = len(StringEntered)

print ("The number of characters in the string that was entered is: ", NumberOfCharacters)

Share

    Recommendations

    • Casting Contest

      Casting Contest
    • Make it Move Contest

      Make it Move Contest
    • Woodworking Contest

      Woodworking Contest
    user

    We have a be nice policy.
    Please be positive and constructive.

    Tips

    Questions

    Comments