Grafioo School
  • Programming Courses
    • Programming and Artificial Intelligence Secondary 1
  • Learn English
    • Unit 3 (Sample Lesson)
    • Unit 4 (Sample Lesson)
    • Extreme Sports (Sample Lesson)
  • Learn French
    • Conjugations
    • Phrases
  • Learn Deutsch
  • Learn Science
    • Digestive System
    • Respiratory System
    • Circulatory System
    • Urinary System
    • Friction Force
    • Atoms
    • Rays
    • science6
  • About Grafioo
Grafioo School
  • Programming Courses
    • Programming and Artificial Intelligence Secondary 1
  • Learn English
    • Unit 3 (Sample Lesson)
    • Unit 4 (Sample Lesson)
    • Extreme Sports (Sample Lesson)
  • Learn French
    • Conjugations
    • Phrases
  • Learn Deutsch
  • Learn Science
    • Digestive System
    • Respiratory System
    • Circulatory System
    • Urinary System
    • Friction Force
    • Atoms
    • Rays
    • science6
  • About Grafioo

Python Loops

for letter in 'Grafioo':
   print 'Current Letter :', letter
Current Letter : G
Current Letter : r
Current Letter : a
Current Letter : f
Current Letter : i
Current Letter : o
Current Letter : o
fruits = ['banana', 'apple', 'mango'] 
for fruit in fruits: 
print 'Current fruit :', fruit 
Current fruit : banana 
Current fruit : apple 
Current fruit : mango
count = 0
while (count < 9):
   print 'The count is:', count
   count = count + 1
The count is: 0
The count is: 1
The count is: 2
The count is: 3
The count is: 4
The count is: 5
The count is: 6
The count is: 7
The count is: 8