Advertisement
Adehumble

Week2 Coding Exercise 8

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