1、running python
#! /usr/bin/python
python sc.py
2、command line interpterer
ipython
3、core language elements
def myfunc(source):
retval = []
for item in source:
if item.startswith(("a", "e", "i", "o", "u")):
retval.append(item.capitalize())
return retval
print myfunc
print myfunc(["hello world", "foobar", "example", "apple"])
numeric data type
a=5
string data type
s='Hello world"
tuple
t-("a","b","c")
list
l=["a","b","c"]
dict
d={"key1": "value1","key2": "value2"}
accessing elements
mydict["key"]
mytuple[0]
mylist[0]
mystring[0]