# HG changeset patch # User Nishanth # Date 1286860006 -19800 # Node ID 5c8e88276e1f6ec54b5edadd44eb665a0b8b6dee # Parent 9ab73cbdd5a8cb212756a8774736ef043c7739f1 input_output is now complete diff -r 9ab73cbdd5a8 -r 5c8e88276e1f input_output/quickref.tex --- a/input_output/quickref.tex Tue Oct 12 10:32:34 2010 +0530 +++ b/input_output/quickref.tex Tue Oct 12 10:36:46 2010 +0530 @@ -1,11 +1,15 @@ -Creating a tuple:\\ -{\ex \lstinline| t = (1, "hello", 2.5)|} +Printing a variable:\\ +{\ex \lstinline| print x|} -Accessing elements of tuples:\\ -{\ex \lstinline| t[index] Ex: t[2]|} +Printing with out a new line:\\ +{\ex \lstinline| print x, |} -Accessing slices of tuples:\\ -{\ex \lstinline| t[start:stop:step]|} +Using modifiers while printing:\\ +{\ex \lstinline| print "a is \%d b is \%f"\%(a, b)|} -Swapping values:\\ -{\ex \lstinline| a, b = b, a|} +Taking input from user:\\ +{\ex \lstinline| x = raw_input()|} + +Display a prompt while taking input:\\ +{\ex \lstinline| x = raw_input("Type a number: ")|} + diff -r 9ab73cbdd5a8 -r 5c8e88276e1f input_output/script.rst --- a/input_output/script.rst Tue Oct 12 10:32:34 2010 +0530 +++ b/input_output/script.rst Tue Oct 12 10:36:46 2010 +0530 @@ -1,17 +1,11 @@ .. Objectives .. ---------- -.. A - Students and teachers from Science and engineering backgrounds - B - - C - - D - - .. #. How to print some value .. #. How to print using modifiers .. #. How to take input from user .. #. How to display a prompt to the user before taking the input - .. Prerequisites .. -------------