I'm trying to write a book cipher decoder, and the following is what i got so far.

```
code = open("code.txt", "r").read() 
my_book = open("book.txt", "r").read() 
book = my_book.txt 
code_line = 0 
while code_line < 6 :
      sl = code.split('\n')[code_line]+'\n'
      paragraph_num = sl.split(' ')[0]
      line_num =  sl.split(' ')[1]
      word_num = sl.split(' ')[2]
      x = x+1

```

the loop changes the following variables:

* paragraph
* line
* word

and every thing is working just fine .

but what I need now is how to specify the paragraph then the line then the word
a for loop in the while loop would work perfectly..

so I want to get from paragraph number "paragraph\_num" and line number "line\_num" the word number "word\_num"

that's my code file, which I'm trying to convert into words

> 
> "paragraph number","line number","word number"
> 
> 
> 

```
70 1 3
50 2 2
21 2 9
28 1 6
71 2 2
27 1 4

```

and then I want my output to look something like this

```
word1
word2  
word3
word4 
word5 
word6

```

by the way , my book "that file that i need to get the words from" looks something like this

> 
> word1 word2 word3
> word4 word5 word6...
> ...word.. word.. **last word**
> 
> 
> 

(The words are **not identical**)

---

Related: [How to count paragraphs?](https://stackoverflow.com/questions/55779830/how-to-count-paragraphs)