PythonBasics: Difference between revisions
From CASA Guides
Jump to navigationJump to search
No edit summary |
No edit summary |
||
Line 12: | Line 12: | ||
== Data Collections: Lists == | == Data Collections: Lists == | ||
Lists are one of the fundamental data collections in python (we will also discuss dictionaries and you may want to read about tuples and sets). | |||
== Data Collections: Dictionaries == | == Data Collections: Dictionaries == | ||
Dictionaries are another basic python data collection. Dictionaries store data in pairs, with a set of unique '''keys''' each mapped to some '''value''' (the values do not have to be unique). Dictionaries are ''extremely'' useful in scripting. For example, imagine that we are reducing a complex set of observations and want to be able to look up a the calibrator associated with a given source. | |||
== Control Flow == | == Control Flow == |
Revision as of 01:28, 10 October 2011
Simple Variables
Basic Math
Ints and Floats
Booleans
Deleting Variables
Checking Whether a Variable Exists
Data Collections: Lists
Lists are one of the fundamental data collections in python (we will also discuss dictionaries and you may want to read about tuples and sets).
Data Collections: Dictionaries
Dictionaries are another basic python data collection. Dictionaries store data in pairs, with a set of unique keys each mapped to some value (the values do not have to be unique). Dictionaries are extremely useful in scripting. For example, imagine that we are reducing a complex set of observations and want to be able to look up a the calibrator associated with a given source.