Python-My Notes
Showing posts with label
basics
.
Show all posts
Showing posts with label
basics
.
Show all posts
Saturday, March 16, 2013
imap and map in python.
›
The imap() function returns an "iterator" that calls a function on the values in the input iterators and returns the results. ...
islice python implementation with examples
›
Pure Pyhton Implemntation: def islice(iterable, *args): # islice('ABCDEFG', 2) --> A B # islice('ABCDEFG', 2, 4...
ZIP in python with examples
›
#!usr/bin/env/python """This(zip) builtin function returns a list of tuples""" x=(1,2,3) y=(4,5,6) z=zip(x,y)...
Friday, March 15, 2013
Itertools chain function
›
Few examples are from the book Python standard library by example. From the Documentation====>The chain() function takes several iter...
Reverse a string in Python
›
Reverse a string in Python How about: Method-1 >>> 'hello world' [::- 1 ] 'dlrow olleh' This is exte...
The Python Slice Notation clear explaination
›
It's pretty simple really: a[start:end] # items start through end-1 a[start:] # items start through the rest of the arra...
Python Idioms
›
Source: http://courses.cms.caltech.edu/cs11/material/python/misc/python_idioms.html Every computer language has "idioms", that...
Friday, March 8, 2013
Interactive "_"
›
Interactive "_" This is a really useful feature that surprisingly few people know. In the interactive interpreter, whene...
Swap Values(variables,lists) in python
›
In other languages: temp = a a = b b = temp In Python: b, a = a, b Perhaps you've seen this before. But do you kn...
›
Home
View web version