Skip to content

Commit 8eb00be

Browse files
committed
29-remove-duplicate-words
1 parent 830c1f3 commit 8eb00be

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
s = input()
2+
words = [word for word in s.split(" ")]
3+
print (" ".join(sorted(list(set(words)))))
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
s = raw_input()
1+
s = input()
22
words = [word for word in s.split(" ")]
3-
print " ".join(sorted(list(set(words))))
3+
print (" ".join(sorted(list(set(words)))))
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import pytest, io, sys, json, mock, re, os
2+
3+
@pytest.mark.it('')
4+
def test_expected_output(capsys, app):
5+
fake_input=['Hola como Hola']
6+
with mock.patch('builtins.input', lambda x: fake_input.pop()):
7+
app()
8+
captured = capsys.readouterr()
9+
assert captured.out != " como \n"

0 commit comments

Comments
 (0)