#练习3-1
def right_justify(monty):
t len( monty ) #s长度
k 70-t #空白长度
print( *k monty )
right_justify( )
#练习3-2 1
def do_twice(f):
f()
f()
def print_spam():
print( spam )
do_twice(print_spam)
# 2
def do_twice(func, arg):
Runs a function twice.
func: function object
arg: argument passed to the function
func(arg)###调用函数
func(arg)
# 3
def print_twice(arg):
Prints the argument twice.
arg: anything printable
print(arg)
print(arg)
# 4
do_twice(print_twice, spam )
# 5
def do_four(func, arg):
Runs a function four times.
func: function object
arg: argument passed to the function
do_twice(func, arg)
do_twice(func, arg)
#练习3-3 1 以以下三种作为简单模型 构造全篇
print( - )
print( ,end )
print( - )
print( ,end )
print( - )
# 2
#和3-2类似
持续加更剩余章节



