I've done the following:
- opened file
- split into list
- made reverse loop by using
forloop - output like below :
# I am interested in position Dualer Master (w/m) im Bereich "Next Generation B2B
B2B
Generation
"Next
Bereich
im
(w/m)
Master
Dualer
position
in
interested
am
I
Now I need to remerge these individual words again into one line, any help?
Below is my code:
fh = open('new.txt', 'r')
for file in fh :
line = file.split()
for word in reversed(line):
print(word)
Your code can generate output like:
By formatting the
printfunction you can remerge the output. LikeIf you want this as string for reusing, you can join the words. Full code
Output: