From 2c6db144a7072c1e4f9580d91b6a309bc62bcec1 Mon Sep 17 00:00:00 2001 From: Abhyuday-Goyal <107510592+Abhyuday-Goyal@users.noreply.github.com> Date: Sat, 6 Aug 2022 01:12:35 +0530 Subject: [PATCH] Update EG6-02 Loop with counter.py --- Ch 06 Loops/EG6-02 Loop with counter.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Ch 06 Loops/EG6-02 Loop with counter.py b/Ch 06 Loops/EG6-02 Loop with counter.py index a8e77bb..7854822 100644 --- a/Ch 06 Loops/EG6-02 Loop with counter.py +++ b/Ch 06 Loops/EG6-02 Loop with counter.py @@ -4,3 +4,11 @@ print('Inside loop') count=count+1 print('Outside loop') + +# An example of count in a loop can be - +n=int(input("enter number:")) +count=0 +while n>0: +count=count+1 +n=n//10 +print("The Count of digits ",count)