Read Until 'stop'

Lab Python Intermediate 20 points

Read lines until you read stop. Each other line is an integer. Print how many numbers were read and their total, as count=C total=T.

Input

Several integers, one per line, then stop.

Output

One line.

Example

Input

5
10
-3
stop

Output

count=3 total=12
Sample input available Sample output available
Editor
Python

Hints

while True: runs forever until a break.

Check for stop before converting to int.

Solution explanation

while True plus break is the standard "loop until a sentinel" pattern.

Show solution
count = total = 0
while True:
    line = input()
    if line == "stop":
        break
    count += 1
    total += int(line)
print(f"count={count} total={total}")
Output
Answer
HOME LEARN COMMUNITY DASHBOARD