Here is the quick reference for Python Programming I found on the web. It summarizes common features and usage in shortest and easiest way possible.
There are also some Princeton University developed modules which are very useful. I have also included them with direct links to it’s corresponding webpage on University’s website.
This is just a blog post taking useful content from Princeton University’s site. For the good intend to share the knowledge with other users and programmers. No intention of modifying or removing credits. Just thought to share this awesome resource with everyone. For more in depth reference, above link to university’s website is advised. It is well documented with excellent documentation and programming examples.
So, here it goes –
import stdio # Write 'Hello, World' to standard output. stdio.writeln('Hello, World')
Editing, compiling, and interpreting.
Built-in data types.
Assignment statements and traces.
if income < 0: rate = 0.00 elif income < 8925: rate = 0.10 elif income < 36250: rate = 0.15 elif income < 87850: rate = 0.23 elif income < 183250: rate = 0.28 elif income < 398350: rate = 0.33 elif income < 400000: rate = 0.35 else: rate = 0.396
while True: x = 1.0 + 2.0*random.random() y = 1.0 + 2.0*random.random() if x*x + y*y <= 1.0: break
suits = ['Clubs', 'Diamonds', 'Hearts', 'Spades']
a = stdarray.create1D(n) ... for i in range(n): stdout.writeln(a[i]) ... for element in a: stdout.writeln(element)
Array aliasing and copying.
a = stdarray.create2D(rowCount, colCount) ... for i in range(rowCount): for j in range(colCount)): stdio.writeln(a[i][j]) ... for row in a: for element in row: stdio.writeln(element)
Redirection and piping.
str data type.
Defining a class.
Creating an object.
Using an object.
p = c1.potentialAt(.20, .50)
stdio module: writing functions.
stdio module: reading functions.
Color data type.
Picture data type.
InStream data type.
OutStream data type.
Pass it on and help others learn if you have too.