print("for loop:")
x = 1
# range boundaries are not inclusive!
for x in range(1,11):
	print(x)

# this while loop is the equivalent of the above.
print("\nwhile loop:")
x = 1
while(x <= 10):
	print(x)
	x += 1

print("\nIterating through a list of strings:")
words = ['cat', 'window', 'defenestrate']
# lists are zero-indexed
words[0] # cat
words[1] # window
words[2] # defenestrate
# this will result in an error "list index out of range"
# words[3]

# list concatenation using the '+' operator
other_words = ['dog', 'door']
#words = words + other_words
#words = other_words + words 
words += other_words
words

# looping through the list
for w in words:
	print(w, len(w))

# if the while condition is True, it will loop infinitely!
print("\nInfinite loop:")
while(True):
	# this always happens
	print("I'm in a loop!")
	# you can't get out unless you use break!
	break
