Guest User

Untitled

a guest
Jan 20th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. '''
  2. Created on Jan 15, 2018
  3.  
  4. @author: Chris
  5. '''
  6.  
  7. def main():
  8. """Ask user for word then calculate total size after
  9. word customization"""
  10.  
  11. word = input('Enter a word to customize: ')
  12. print(word)
  13.  
  14. print(len(word))
  15.  
  16. length = 25 ** len(word)
  17.  
  18. print('This will create ' ,length,' words.')
  19. answer = input('Do you want to continue? Y or N \n')
  20.  
  21. """Selection statement. Yes to continue,
  22. no to stop program"""
  23.  
  24. if answer.upper() == 'Y':
  25. print('Lets do this')
  26.  
  27. """Get letter to change from word"""
  28. getLetter(word, index)
  29. print(letter,index)
  30.  
  31. """Replace letter in word"""
  32. replacer(word, letter, index)
  33.  
  34. else:
  35. print('Goodbye')
  36.  
  37. def replacer(word, letter, index):
  38. print(word[:index] + letter + word[index:])
  39.  
  40. def getLetter(letter, index):
  41. return(letter[index])
  42.  
  43. if __name__ == '__main__':
  44. main()
Add Comment
Please, Sign In to add comment