I’m self teaching myself python by delving right in. I’m not sure if a function does this if you leave it empty:
#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"
My question is, is there a way to make it nicer looking and with fewer lines of code? Or am I stuck with having 10 lines of print?
If you want to show different messages, you can define a function that receives the message to be printed: