Python Programming - String Traversal

Published

Introduction: Python Programming - String Traversal

About: Occupation: Tech Support

Short Python program that demonstrates string traversal of an entered word or phrase. Below and attached.

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

print("This program will print out each letter in an entered word or phrase.")

EnteredString = input("Enter a word or phrase: ")
print ("The string entered is: ", EnteredString)

# This for loop will print out each letter on a line
for EachLetter in EnteredString:
print("The letter is:", EachLetter)

LengthOfString = len(EnteredString)
print ("The number of characters is: ", LengthOfString)

Share

    Recommendations

    • Clocks Contest

      Clocks Contest
    • Casting Contest

      Casting Contest
    • Planter Challenge

      Planter Challenge
    user

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

    Tips

    Questions

    Comments