Time :-
import time
k=0
j =0
intial_time = time.time()
while (k<=100):
print("q")
time.sleep(1)
k+=1
print("while loop time is :- ",time.time() - intial_time)
intial_time2 = time.time()
for k in range(100):
print("r")
j+=1
Time :-
import time
k=0
j =0
intial_time = time.time()
while (k<=100):
print("q")
time.sleep(1)
k+=1
print("while loop time is :- ",time.time() - intial_time)
intial_time2 = time.time()
for k in range(100):
print("r")
j+=1
0Comments
Thanks you for commenting your questions. I will see question and respond you.