Advertisement
Adehumble

Week2 Coding Exercise 9

Feb 9th, 2020
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.54 KB | None | 0 0
  1. #9
  2. def last_five_characters(character):
  3.     while len(character)<5:
  4.         print("You MUST enter a word with at least 5 characters. \nPlease, TRY AGAIN!")
  5.         break
  6.     else:
  7.         print(character[-5:])
  8.  
  9. print("\tHello! Dear User. This program is written to test prints out the last five characters of your input. \n \tIt will prompts a DEFAULT ERROR STATEMENT if the word is not up to five characters. The program will also AUTOMATICALLY ends. \n \tHave Fun!")
  10. print("_______"*17)
  11. word=input("Enter any word of your choice,  ")
  12. last_five_characters(word)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement