Skip to content

Instantly share code, notes, and snippets.

@buddypia
Created November 9, 2020 04:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save buddypia/6ee7d6b966c0685b304aa67a99111dd5 to your computer and use it in GitHub Desktop.
Save buddypia/6ee7d6b966c0685b304aa67a99111dd5 to your computer and use it in GitHub Desktop.
분배법칙
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)
@buddypia
Copy link
Author

buddypia commented Nov 9, 2020

사용은 이런식으로 하시면 됩니다.
$ python distributive.py 'AB CD' 'EF GH'
ABEF+ABGH+CDEF+CDGH

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment