For the counter controlled loop that is supposed to print "hello" 500 times the range should be set to 501, since otherwise it will only print 499 "hello's"
for i in range(501):
print(i)
print("hello!")
Similarly to print 500 times via this method the bound should be 501
i = 0
while i < 501:
print(f"hello! {i}")
i += 1
For the counter controlled loop that is supposed to print "hello" 500 times the range should be set to 501, since otherwise it will only print 499 "hello's"
for i in range(501): print(i) print("hello!")
Similarly to print 500 times via this method the bound should be 501 i = 0 while i < 501: print(f"hello! {i}") i += 1