Python Tutorial
- Python Reference
A list of useful website and textbook review - csci133c1.py Basic Hello World, declare variables, simple for loop control statement
- csci133c2.py Nested for loops, list, counting, if statement
- csci133c3.py Introduction to function, string's class function, useful tip for handling string
- csci133c4.py Opening a file, and using everything we know together. Additional to a brief review practice problem, introduce dictionary
- csci133c5.py
Talks about function, what are they, how to define them - csci133c6.py
A taste of python's GUI, Tkinter. Introducing the title, frame, button, input widget, and what they can do with each other - csci133buildin.py
Discuss what are the build-in data type (Object) in Python - csci133number.py
Document Integer, Float, Long, and Complex number - csci133class.py
Some notes I have on python's class, tkinter's other module - csci133ifelif
Demonstration of the uses of if and elif (else-if) keyword - csci133c7.py
Classic how to clean up a string and storing the string's corresponding line numbers, it discuss the use all the things we learned so far - csci133c8.py
Some notes on the python's class, and subclass too - csci133allCombination.py
Example of why nest while loop is bad, and how to use one if you really must have it. Plus counter solutions. - csci133rep1.py
An example of how to validate input of telephone number in a specific format, demonstrating simple use of regular expression in python. - csci133averageGPA.py
Simple exercise program to calculate the grade point average - csci133rockPaperScissors.py
A game of rock, paper, scissor implemented in python - csci133clock.py
An example of how to make a clock with tkinter in Python - csci133timer.py
A tutorial on how to build a timer with tkinter in Python
Stackoverflow Goodies
- Python: Get the most frequent elements from list when there is more than one
Given a list that is unsorted, how do you get the most frequent appeared element? - Python: Regular Expression 101 Example Code
A very simple demonstration of Python's Regular Expression, in particular, how to validate if a telephone number is in the format we want xxx-xxx-xxxx - Python: How to print the ValueError Error Message
It is actually better to expect error than to test them out - Python: [] vs. {} vs. ()
A flash card for: list vs. dictionary / set vs. tuple - Python Tkinter: How to change window size without using canvas
Use the .pack_propagate() method to change the flag - Python: When NOT To use Global Variable, Use Return!
Why you might not want to use global variable all the time, and what do you do with returned values. - Python: How to remove, or pop an element randomly from a list
Use randrange() instead of random.choice(range(myList)) - Python: How to search a list of class element by their data
Put the _classVariable into a dictinoary {} into your class - Python: How to find the integer and float in a string
If you given a string in the form of an equation, how to extract the integer and float from the string. Beginner style! No regular expression used. - Python: How to insert characters to the string at the end
Example of 3 different way you can insert some characters into the string - Python: How to load image to tkinter window example (GIF only)
Example to how to load an image and display on the tkinter
C++ Tutorial
- C++ Resource Discussion about what are the good reference for the class
- csci135c1.cpp Hello world, talks about cout and endl
- csci135c2.cpp More cout, and for loop
- csci135c3.cpp while loops and do while loop tutorial in great details