Created
November 9, 2020 04:52
-
-
Save buddypia/6ee7d6b966c0685b304aa67a99111dd5 to your computer and use it in GitHub Desktop.
분배법칙
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
result_str = '' | |
for val1 in sys.argv[1].split(): | |
for val2 in sys.argv[2].split(): | |
result_str += val1 + '*' + val2 | |
result_str += '+' | |
if result_str[-1] == '+': | |
result_str = result_str[:-1] | |
print(result_str) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
사용은 이런식으로 하시면 됩니다.
$ python distributive.py 'AB CD' 'EF GH'
ABEF+ABGH+CDEF+CDGH