In [2]:
temp = 70
if temp < 30:
print("It's really cold!")
if temp < 65:
print("It's cold!")
if temp > 100:
print("It's really hot")
if temp > 85:
print("It's hot!")
else:
print("The temperature is fine")
In [3]:
words = ['cat', 'window', 'defenestrate']
In [4]:
for w in words:
print(w)
In [5]:
for i in range(len(words)):
print(words[i])
In [6]:
range(len(words))
Out[6]:
In [7]:
n = 0
while n < 5:
n += 1
print(n)
In [10]:
j = 0
while j < 5:
j = 0
j += 1
print(j)
In [ ]:
In [ ]: