我通过深入研究自学python。如果你把它留空,我不确定一个函数是否会这样做:
#My first section that pulls a value from a random shuffle of codes
print "\n"
print "-"*10
print 'This is a test of the %s system'% codes[0]
print "-"*10
print "\n"
#My second section that pulls a value from a random shuffle of codes
print "\n"
print "-"*10
print 'This is not a test of the %s system and all is good'% codes[1]
print "-"*10
print "\n"
我的问题是,有没有办法让它看起来更好看,代码行更少?还是我坚持打印 10 行?