Conditions | 4 |
Total Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Changes | 9 | ||
Bugs | 6 | Features | 3 |
1 | #!/usr/bin/python |
||
16 | def main(separator='\t'): |
||
17 | ''' |
||
18 | This function get input file from sys.stdin (argument passing in terminal) and pass this file to read_input function |
||
19 | in each output of read_input function check list items if char number of each word larger than 0 (word validation) |
||
20 | sort letter of word and print sorted word and first word with a separator(default value ="\t") to terminal |
||
21 | :param separator: separator for sorted word and first word |
||
22 | :type separator:str |
||
23 | :return: None |
||
24 | ''' |
||
25 | for words in read_input(sys.stdin): |
||
26 | for word in words: |
||
27 | if len(word) > 0: |
||
28 | print '%s%s%s' % (''.join(sorted(word)), separator, word) |
||
29 | if __name__ == "__main__": |
||
31 |