You are on page 1of 2

###########

##SYMBOLS##
###########
~ (tild sign)
$ (dollar sign)
^ (caret sign)
# (octothorpe/pound/hash/mesh sign)
+ (plus sign)
- (minus sign)
* (astrick sign)
/ (forward slash or divide sign)
\ (backward slash)
% (percent sign or modulus sign)
< (less-tan sign)
> (greater-than sign)
<= (less-tahn-equal sign)
>= (greater-than-equal sign)
= (single-equal sign)
== (double-equal sign)
' (single inverted commas or singlequotes)
" (double nverted commas or doublequotes)
. (dot or period)
( ) (parentheses)
, (comma)
_ (underscore)
? (question mark)
: (colon)
! (exclamatary sign)
####################
##Escape Sequences##
####################
Escape

What it does

\\
\'
\"
\a
\b
\f
\n
\N{name}
ly)
\r
\t
\uxxxx
\Uxxxxxxxx
\v
\ooo
\xhh

Backslash (\)
Single- quote (')
Double- quote (")
ASCII bell (BEL)
ASCII backspace (BS)
ASCII formfeed (FF)
ASCII linefeed (LF)
Character named name in the Unicode database (Unicode on
ASCII carriage return (CR)
ASCII horizontal tab (TAB)
Character with 16- bit hex value xxxx (Unicode only)
Character with 32- bit hex value xxxxxxxx (Unicode only)
ASCII vertical tab (VT)
Character with octal value oo
Character with hex value hh

########
##CODE##
########
Code

What it does

print
print out the data in screen
%s
repalce string
%d
replace number
%f
replace float
%.2f
float precise till 2 decimal place
raw_input()
takes raw data provided by user /* eg. data1 = raw_inpu
t() i.e. take any raw string
data2 = int(raw_input()) i.e. take raw data and convert it into integer
data2 = float(raw_input()) i.e. take raw data and convert it into float
data2 = double(raw_input()) i.e. take raw data and convert it into double
*/
import
open(f)
ile in read mode

use to add feature/module/function // eg. import os


open file f /* eg.
txt = open(filename) i.e. open f
txt = op

en(filename, 'r') i.e. open file in read mode


txt = op
en(filename, 'w') i.e. open file in write mode
txt = op
en(filename, 'a') i.e. open file in append or update mode
txt = op
en(filename, 'w+r') i.e. open file in read and write mode
*/
read()
read data from file // eg. txt.read()
write()
write data into file // eg. txt.write("Write anything yo
u want to include in file")
truncate()
truncate or delete data inside file // eg. txt.truncate(
)
close()
close a.k.a save the file // eg. txt.close()
len(f)
provide the length of a data // eg. len("Debakar") give
7 bytes
argv
argument variable
def
use to declare functions // eg. def print_one(arg1)
seek()
point the pointer on describe byte // eg. txt.seek(0)
readline()
read a line from the file // eg. txt.readlne()
return
return value from a function // return 30 + 60

You might also like