input_output/quickref.tex
author Nishanth <nishanth@fossee.in>
Tue, 12 Oct 2010 10:36:46 +0530
changeset 329 5c8e88276e1f
parent 236 33828497b5da
permissions -rw-r--r--
input_output is now complete
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
329
5c8e88276e1f input_output is now complete
Nishanth <nishanth@fossee.in>
parents: 236
diff changeset
     1
Printing a variable:\\
5c8e88276e1f input_output is now complete
Nishanth <nishanth@fossee.in>
parents: 236
diff changeset
     2
{\ex \lstinline|    print x|}
236
33828497b5da Converted input_output to new template form
Nishanth <nishanth@fossee.in>
parents:
diff changeset
     3
329
5c8e88276e1f input_output is now complete
Nishanth <nishanth@fossee.in>
parents: 236
diff changeset
     4
Printing with out a new line:\\
5c8e88276e1f input_output is now complete
Nishanth <nishanth@fossee.in>
parents: 236
diff changeset
     5
{\ex \lstinline|    print x, |}
236
33828497b5da Converted input_output to new template form
Nishanth <nishanth@fossee.in>
parents:
diff changeset
     6
329
5c8e88276e1f input_output is now complete
Nishanth <nishanth@fossee.in>
parents: 236
diff changeset
     7
Using modifiers while printing:\\
5c8e88276e1f input_output is now complete
Nishanth <nishanth@fossee.in>
parents: 236
diff changeset
     8
{\ex \lstinline|    print "a is \%d b is \%f"\%(a, b)|}
236
33828497b5da Converted input_output to new template form
Nishanth <nishanth@fossee.in>
parents:
diff changeset
     9
329
5c8e88276e1f input_output is now complete
Nishanth <nishanth@fossee.in>
parents: 236
diff changeset
    10
Taking input from user:\\
5c8e88276e1f input_output is now complete
Nishanth <nishanth@fossee.in>
parents: 236
diff changeset
    11
{\ex \lstinline|    x = raw_input()|}
5c8e88276e1f input_output is now complete
Nishanth <nishanth@fossee.in>
parents: 236
diff changeset
    12
5c8e88276e1f input_output is now complete
Nishanth <nishanth@fossee.in>
parents: 236
diff changeset
    13
Display a prompt while taking input:\\
5c8e88276e1f input_output is now complete
Nishanth <nishanth@fossee.in>
parents: 236
diff changeset
    14
{\ex \lstinline|    x = raw_input("Type a number: ")|}
5c8e88276e1f input_output is now complete
Nishanth <nishanth@fossee.in>
parents: 236
diff changeset
    15