Python an Introduction to Dictionary and Loops in English. This presentation has been prepared to take the class in live youtube stream https://youtu.be/dPm4mhuEEbI
13. for i in range(1, 5):
print i
print 'The for loop is over'
14. for i in ["apple", "banana", "cherry"]:
print i
print 'The for loop is over'
15. for i in range(1, 5):
for j in range (10,20):
print i,j
print 'The for loop is over'
16. number = 23
running = True
while running :
guess = int(raw_input('Enter an integer : '))
if guess == number :
print 'Congratulations, you guessed it.'
running = False
elif guess < number :
print 'No, it is a little higher than that.'
else:
print 'No, it is a little lower than that.'
print 'Done'
17. number = 23
while True :
guess = int(raw_input('Enter an integer : '))
if guess == number :
print 'Congratulations, you guessed it.'
break
elif guess < number :
print 'No, it is a little higher than that.'
else:
print 'No, it is a little lower than that.'
print 'Done'