mirror of
https://github.com/bendtherules/pytry.git
synced 2026-08-18 13:53:01 +00:00
All the previous files
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
def remove_dup(line):
|
||||
words=line.split()
|
||||
final=""
|
||||
check=words[0]
|
||||
final+=check
|
||||
for word in words[1:]:
|
||||
if word!=check:
|
||||
final+=" "+word
|
||||
check=word
|
||||
answers.append(final)
|
||||
|
||||
answers=[]
|
||||
f=open(r"C:\Users\Abhas_2\Desktop\input(1).txt")
|
||||
times=input()
|
||||
for count in range(times):
|
||||
remove_dup(raw_input())
|
||||
for answer in answers:
|
||||
print(answer)
|
||||
Reference in New Issue
Block a user