[Tutor] how do I make my code better?
keith papa
keithadu at live.com
Mon Aug 18 21:18:07 CEST 2014
Am a newbie and I decided to code a program that you input a round number and spit out the list of names or other information? how do I make this better? how do I make the code repeat itself, so I can keep asking the program to print out list of names for a variable?
here my code:
print 'Hello TheNetWork A' round1 = "First Round players: [Jamaal Charles RB KC], [LeSean McCoy RB PHI], [Calvin Johnson WR DET]" round2 = "Second round player: [Matt Forte RB CHI], [Eddie Lacy RB GB]," round3 = "Third Round players: [Peyton Manning QB DEN], [Jimmy Graham TE NO], [Demaryius Thomas WR DEN]" round4 = '[Dez Bryant WR DAL], [A.J. Green WR CIN],[ Brandon Marshall WR CHI], [Julio Jones WR ATL]' answer =raw_input('Enter round number here: \n')if answer == 'round1': print round1if answer == 'round2': print round2if answer == 'round3': print round3if answer == 'round4': print round4
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20140818/68ab14b4/attachment-0001.html>
More information about the Tutor
mailing list