Advertisement
Vikis

Hello.py

Nov 12th, 2018
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. #!/usr/bin/python3
  2. response = input ("Hello, what is your name?\n >")
  3.  
  4. name_prefix = 'name is'
  5. name_prefix_star = response.find(name_prefix)
  6. name_prefix_size = len(name_prefix)
  7.  
  8. if name_prefix_star > -1
  9. name prefix _star + name_prefix_size + 1
  10. name = response[name_star:]
  11. print('Hello {}!'.format(name))
  12. else:
  13. print("не знаходимо твоє імя"
  14. "My name is <your name here")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement