Skip to content

Latest commit

 

History

History
16 lines (15 loc) · 1.4 KB

File metadata and controls

16 lines (15 loc) · 1.4 KB

Python_Examples

Examples of Python code and library use:

  • coins.py - Given an amount, list the coins required to make the amount.
  • contextmgrsample.py - Implementation of a simple Context Manager in Python
  • maxReturnPath.py - Given a 2D matrix, and traveling only right and down, maximize the sum of the values found at each cell visited.
  • number2text.py - This program reads a number from the user, and converts the number to its written text equivalent.
  • path.py - This program finds the shortest weighted path through a set of given nodes. path.json contains demonstration data.
  • PiMonteCarlo.py - Estimate Pi using random numbers.
  • roomsNeeded.py - Given the lengths of the class and their start times, how many classrooms are required to hold the sessions, taking into account the sessions that overlap.
  • spdtst.py - Example using the speedtest-cli API to test your Internet speed.
  • spiral.py - Given a 2D list, print the values in a spiral from outside to center.
  • sums.py - Given a list and a target value, return True if the target is the exact sum of any subset of the list.
  • swaps.py - Given an integer, swap its even and odd bits throughout.
  • uniques.py - Given a list of values, return the values which only occur once.
  • webpage2json.py - This program reads a web page from the iSeries IBM site, uses BeautifulSoup to extract a table of updates, and saves the details about those updates in JSON to stdout.