Ada-Developers-Academy / ada-build

Ada Build is curriculum that is intended for anyone who is interested in beginning their journey into coding.
744 stars 419 forks source link

Colaboratory Notebook Lesson 5 Loops #301

Closed mikaturner closed 1 year ago

mikaturner commented 1 year ago

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

mikaturner commented 1 year ago

Oops I forgot both ranges started at 0, so the original solutions are correct.