cs107-lecture-examples

Example codes used during Harvard CS107 lectures
git clone https://git.0xfab.ch/cs107-lecture-examples.git
Log | Files | Refs | README | LICENSE

my_module.py (227B)


      1 #!/usr/bin/env python3
      2 import time
      3 
      4 def fast():
      5     time.sleep(0.5)
      6 
      7 def slow():
      8     time.sleep(1)
      9 
     10 def main():
     11     for i in range(5):
     12         fast()
     13     for i in range(3):
     14         slow()
     15 
     16 if __name__ == "__main__":
     17     main()