# HG changeset patch # User Nishanth # Date 1286861013 -19800 # Node ID e3136f576acbb1e7a45eb4e3976a7c019ae6f783 # Parent efb8ddf26aff372797bbdb97a0de55c8ab83e3e5 Finished parsing_data diff -r efb8ddf26aff -r e3136f576acb parsing_data/quickref.tex --- a/parsing_data/quickref.tex Tue Oct 12 10:47:28 2010 +0530 +++ b/parsing_data/quickref.tex Tue Oct 12 10:53:33 2010 +0530 @@ -1,11 +1,15 @@ -Creating a tuple:\\ -{\ex \lstinline| t = (1, "hello", 2.5)|} +Splitting a string on whitespace:\\ +{\ex \lstinline| str_var.split()|} -Accessing elements of tuples:\\ -{\ex \lstinline| t[index] Ex: t[2]|} +Splitting a string using a delimiter. Ex: ";" :\\ +{\ex \lstinline| str_var.split(";")|} -Accessing slices of tuples:\\ -{\ex \lstinline| t[start:stop:step]|} +Stripping the whitespace around a string:\\ +{\ex \lstinline| str_var.strip()|} -Swapping values:\\ -{\ex \lstinline| a, b = b, a|} +Converting a string or float to int:\\ +{\ex \lstinline| int(var_name)|} + +Converting a string or int into float:\\ +{\ex \lstinline| float(var_name)|} +