class Test(object):
"""Test class,提供通用的方法"""
def __init__(self):
"""Test的构造器:"""
pass
def function1(self):
pass
def function2(self):
pass
def function3():
pass
非集合元素
with open('test.txt','w') as file_1, \
open("test2.txt", 'w') as file_2:
file_2.write(file_1.read())
query_str = ('my name'
'is'
' %s') % "Tom"
print query_str
income = (gross_wages
+ taxable_interest
+ (dividends - qualified_dividends)
- ira_deduction
- student_loan_interest)
集合元素
my_list = [
1, 2, 3,
4, 5, 6,
]
result = some_function_that_takes_arguments(
'a', 'b', 'c',
'd', 'e', 'f',
)
#if and
if (this_is_one_thing
and that_is_another_thing):
do_something()
# function
def long_function_name(
var_one, var_two,
var_three,var_four):
print(var_one)