Xom9ik

Lab_3-2/6var (IV semester) .py

Mar 27th, 2018
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.44 KB | None | 0 0
  1. from random import choice
  2. print("Task 2")
  3.  
  4. length = int(input('Length of the string: '))
  5. cyrillic = ('А','Б','В','Г','Д','Е','Ё','Ж','З','И','Й','К','Л','М','Н','О','П','Р','С','Т','У','Ф','Х','Ц','Ч','Ш','Щ','Ъ','Ы','Ь','Э','Ю','Я')
  6. rand_str = ''.join(choice(cyrillic) for i in range(length))
  7. print(rand_str)
  8. find = input('Search symbol: ')
  9. print("Symbol >", find, "< index: ", rand_str.find(find), sep='')
Advertisement
Add Comment
Please, Sign In to add comment