Programming in Python
Over the weekend -- we enjoyed our first bit of work in Python.
So Far
This exercise sumarizes what we have learned in the Google Python Exercises. There is a lot more there, along with YouTube videos by Nick Parlante to explain the exercises.
Open small.txt as a string and display it
Convert to lower case. Split on the whitespace. Alphabetize. Display.
Count the instances of each member of the array.
Display in the form (word1, count1), (word2, count2)
You can run the code calling small.txt at the command line, after you save the code in an editor such as Notepad++ with file extension py.
Introduction to Python
Python String
- String1.py from Google Code University
- String Slice Function, Instructions
- String Slice Function, Code
- String Slice Function, Test
- String Slice Function, Result
- Replace Char, Instructions
- Replace Char, Code
- Replace Char, Test
- Replace Char, Result
- Substitute/Swap, Instructions
- Substitute/Swap, Code
- Substitute/Swap, Test
- Substitute/Swap, Result
- Function with Arg, Instructions
- Function with Arg, Code
- Function with Arg, Test
- Function with Arg, Result
Python List
- List1.py, from Google Code University
- Search List, Instructions
- Search List, Code
- Search List, Test
- Search List, Result
- Modify List, Instructions
- Modify List, Code
- Modify List, Test
- Modify List, Result
- Sort on Last, Instructions
- Sort on Last, Code
- Sort on Last, Test
- Sort on Last, Result
Python File Read/Write