SHARE
TWEET

Untitled

a guest Jan 14th, 2020 66 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ###קוד###
  2.  
  3. def choose_word(file_path, index):
  4.     text = open(file_path, "r")
  5.     words = text.split()
  6.     words_in_text = []
  7.     for word in r_of_w:
  8.         if word not in words_in_text:
  9.             words_in_text += word
  10.     if index <= (ln(words_in_text)):
  11.         the_word = words[(index-1)]
  12.     else:
  13.         the_word = words[((index%(ln(words_in_text)))-1)]
  14.     output = (ln(words_in_text),the_word)
  15.     text.close()
  16.     return output
  17.  
  18.  
  19. ####שגיאה###
  20.  
  21. words = text.split()
  22. AttributeError: '_io.TextIOWrapper' object has no attribute 'split'
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top