Your browser does not support JavaScript!
Please enable JavaScript to use the full functionality of the site.
Without JavaScript, you will not be able to expand the content tables in the PD Materials Page and CSP Index Page.

PD4CS

Professional Development for CS Principles Teaching

Log in

Menu

Skip to content
  • Home
  • CSP Index
  • PLTW Index
  • Resources
  • About

Home » Loops » Loops – Python

Loops – Python

Listed below are the examples about Loops in Python. The icon video included in the hover-over text means there are video(s) included in the post.
  • Example 1: Why do we need loops?
  • Example 2: Given two strings, find all characters appearing in both.
  • Example 3: Print all the integers from 1 to 1000 that are multiples of both 6 and 10.
  • Example 4: Better deal?
  • Example 5: Palindromes
  • Example 6: Sum up the digits in an integer 
  • Example 7: Guess a chosen letter in the alphabet
  • Example 8: The use of a sentinel value in while loops
  • Example 9: Converting a for-loop into a while loop
  • Example 10: Are all these loops doing the same thing?
  • Example 11: Sum up the digits in an integer
  • Example 12: Find the greatest common divisor (GCD) of two integers.
nsf1 This work is supported by the National Science Foundation under grant number 1502462. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the National Science Foundation"
Proudly powered by WordPress | If you have questions, please contact PD4CS Research Team