Skip to content

Instantly share code, notes, and snippets.

@ivikash
Created October 31, 2011 11:09
Show Gist options
  • Save ivikash/1327294 to your computer and use it in GitHub Desktop.
Save ivikash/1327294 to your computer and use it in GitHub Desktop.
To check all the parenthesis are closed or not
import fileinput
flag = 0
# for line in fileinput.input():
# if (line.count("{") - line.count("}")!=0):
# print line
lines = [line for line in fileinput.input() if (line.count("{") - line.count("}")!=0)]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment