Practical Bioinformatics Mark Voorhies 5/21/2013 Mark Voorhies - - PowerPoint PPT Presentation

practical bioinformatics
SMART_READER_LITE
LIVE PREVIEW

Practical Bioinformatics Mark Voorhies 5/21/2013 Mark Voorhies - - PowerPoint PPT Presentation

Practical Bioinformatics Mark Voorhies 5/21/2013 Mark Voorhies Practical Bioinformatics Gotchas Enclosing symbols (,,(),[],...) need to be matched Mark Voorhies Practical Bioinformatics Gotchas Enclosing symbols


slide-1
SLIDE 1

Practical Bioinformatics

Mark Voorhies 5/21/2013

Mark Voorhies Practical Bioinformatics

slide-2
SLIDE 2

Gotchas

Enclosing symbols (””,”,(),[],...) need to be matched

Mark Voorhies Practical Bioinformatics

slide-3
SLIDE 3

Gotchas

Enclosing symbols (””,”,(),[],...) need to be matched Pay attention to IPython’s syntax highlighting to match your quotes.

Mark Voorhies Practical Bioinformatics

slide-4
SLIDE 4

Gotchas

Enclosing symbols (””,”,(),[],...) need to be matched Pay attention to IPython’s syntax highlighting to match your quotes. IPython highlights parens for the current cursor position in green

Mark Voorhies Practical Bioinformatics

slide-5
SLIDE 5

Gotchas

Statements that precede code blocks (if, def, for, while, ...) end with a colon. def mean( x ) : s = 0.0 for i in x : s += i return s / l e n ( x )

Mark Voorhies Practical Bioinformatics

slide-6
SLIDE 6

Gotchas

Statements that precede code blocks (if, def, for, while, ...) end with a colon. def mean( x ) : s = 0.0 for i in x : s += i return s / l e n ( x ) Loop variables retain their state after the loop is finished (so if you want to reuse the variable, you need to reinitialize it).

Mark Voorhies Practical Bioinformatics

slide-7
SLIDE 7

Mean

def mean( x ) : s = 0.0 for i in x : s += i return s / l e n ( x ) def mean( x ) : return sum( x )/ f l o a t ( l e n ( x ))

Mark Voorhies Practical Bioinformatics