Coding_Algorithm/Python
[repl.it] 4.7. For: Number of zeros Solutions/풀이
몇개를 입력받을지 입력받아 정한 후, 0이라고 입력한 갯수를 세라고 하네요. N = int(input()) cnt=0 for i in range(N): if(int(input()) == 0): cnt += 1; print(cnt) 사실 if문 조건을 저렇게 괄호로 안씌워줘도 됩니다. 근데 C언어를 하던 관성이 남아있어서.. 아 참고로 python3에서는 C언어에서의 ++이 없다는거 알아두세요. (1을 더해주는 기능)