Tagged: counter
Everything tagged "counter", newest first.
Python Coding Exercise #53: The Sum of Consecutive Numbers
Two beginner Python exercises on a while loop that adds 1, 2, 3 and so on until the total reaches a limit, then builds the calculation as text to print it too.
Python Coding Exercise #51: Even Numbers, Countdown and Counting Up
Three beginner Python exercises on while loops with a condition instead of while True — print the even numbers up to 30, fix a broken countdown, and print every number below a limit.
Python Coding Exercise #50: Working with Numbers
A beginner Python exercise on collecting statistics in a loop — read numbers until the user types zero, then print the count, the sum, the mean, and how many numbers were positive and negative.
Python Coding Exercise #47: PIN and Number of Attempts
A beginner Python exercise on loops and counters — keep asking for a PIN until it is correct, count the attempts, and print a different message when it takes only one try.