prusev71

Помощ със задачата Mock Exam 4 Title Search Python

Jun 16th, 2024
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | Software | 0 0
  1. output = []
  2.  
  3. str2 = 'No such title found!'
  4.  
  5. def convert(s):
  6. str1 = ""
  7. return(str1.join(s))
  8.  
  9. def split(word):
  10. return list(word)
  11.  
  12. let_t = split(input())
  13.  
  14. n = int(input())
  15.  
  16. for i in range(n):
  17.  
  18. str_i = split(input())
  19.  
  20. for j in range(len(str_i)):
  21.  
  22. if str_i[j] in let_t:
  23.  
  24. let_t.index(str_i[j])
  25.  
  26. x = let_t.index(str_i[j])
  27.  
  28. let_t.remove(let_t[x])
  29.  
  30. k = convert(let_t)
  31.  
  32. output.append(k)
  33.  
  34. print(output)
Tags: python
Advertisement
Add Comment
Please, Sign In to add comment