summaryrefslogtreecommitdiff
path: root/input_output/quickref.tex
blob: 43629cae9823e237622072897e36b2677a451d24 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Printing a variable:\\
{\ex \lstinline|    print x|}

Printing with out a new line:\\
{\ex \lstinline|    print x, |}

Using modifiers while printing:\\
{\ex \lstinline|    print "a is \%d b is \%f"\%(a, b)|}

Taking input from user:\\
{\ex \lstinline|    x = raw_input()|}

Display a prompt while taking input:\\
{\ex \lstinline|    x = raw_input("Type a number: ")|}