Solve problem "The length of the sequence" online - Learn Python 3 - Snakify

Problem «The length of the sequence» (Easy)


Statement

Given a sequence of non-negative integers, where each number is written in a separate line. Determine the length of the sequence, where the sequence ends when the integer is equal to 0. Print the length of the sequence (not counting the integer 0). The numbers following the number 0 should be omitted.

In all the problems input the data using input() and print the result using print().



Saved solutions

Tests

Input Correct answer Result
1
7
9
0
5
3
1
2
3
4
5
6
7
0
1
2
3
7
100
0
1
0
0
5
2
8
0
1
4
4
3
2
0
5
0
0
3