Advertisement
Guest User

Untitled

a guest
Dec 26th, 2015
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. import random
  2.  
  3.  
  4. alph = "qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM"
  5. text = "Aryslan"
  6. cnt = 0
  7. currstring = ""
  8. currsym = 0
  9. while True:
  10. sym = random.choice(alph)
  11. cnt += 1
  12. if sym == text[currsym]:
  13. currstring += sym
  14. if currsym == len(text) - 1:
  15. print(cnt, currstring)
  16. break
  17. currsym += 1
  18. continue
  19. currstring = ""
  20. currsym = 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement