Nov-22-2018, 10:24 PM
Still pretty new to programming and Python but I am picking it up and enjoy learning. This is part of a homework lab which just asks to create a simple multiplication table that ranges from 2x2 to 10x10. No problem but it also wants me to follow every even number in the table up with a "#". I have tried countless methods but everything I try either throws the table into chaos or pulls up an exception. A little bit of guidance as to what I'm missing in my code would be a huge help. Here's what I have on my own:
print("\t\t\t Multiplication Table") print("===================================================================================\n") # top row choice= "y" while choice.lower() =="y": num=int(input("What size table would you like? Enter integer from 2-10: ")) if num < 2 and num > 10: print("Please enter a integer in the range of 2-10. ") else: print() string='' topRowString = '' for column in range(1,num+1): topRowString += '\t' + str(column) print(topRowString) print("===================================================================================") string += topRowString + '\n' # subsequent rows for row in range(1,num+1): rowString = str(row) for column in range(1,num+1): rowString += '\t' + str(row*column) print(rowString) string += rowString + '\n' choice = input("Would you like another table? ")