From 5a0ceaf5f0fbc8bc422ae9ef1eb1c7aa9fd5e029 Mon Sep 17 00:00:00 2001 From: kim_yubin Date: Fri, 19 Oct 2018 18:59:43 +0900 Subject: [PATCH] =?UTF-8?q?=EC=B6=94=EA=B0=80=20'=EB=8C=80=EA=B4=84?= =?UTF-8?q?=ED=98=B8=20=EA=B7=9C=EC=B9=99.py'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 대괄호 규칙.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 대괄호 규칙.py diff --git a/대괄호 규칙.py b/대괄호 규칙.py new file mode 100644 index 0000000..bfcdc39 --- /dev/null +++ b/대괄호 규칙.py @@ -0,0 +1,19 @@ +a=input("문장을 입력하십시오. : ") +b=[] +b=a +t=0 +u=0 + +while t < len(b): + if b[t] is "[": + u+=1 + if b[t] is "]": + u-=1 + if u < 0: + break + t+=1 + +if u is 0: + print("올바른 문장") +else: + print("잘못된 입력방식") \ No newline at end of file