Question: I have many issues with my code. It seems like it should work, but I have a lot of errors and Zybooks is very picky.

I have many issues with my code. It seems like it should work, but I have a lot of errors and Zybooks is very picky. I have been racking my brain trying to correct the issues. I have included my Python 3 code, so that any errors could be spotted and corrected. Thank you!

I have many issues with my code. It seems like it shouldwork, but I have a lot of errors and Zybooks is very

mylist1 = [] mylist2 = []

var = input("Enter a title for the data: ") print ("You entered:", var)

heading1 = input("Enter the column 1 header:") print ("You entered:", heading1)

heading2 = input("Enter the column 2 header: ") print ("You entered:", heading2) counter = 0 while True: value = input("Enter a data point(-1 to stop input): ") if value == "-1": break else: for c in value: if(c == ','): counter +=1 if(counter =2): print('Too many commas in input') else: val,num = value.split(',') try: int(num) mylist1.append(val) mylist2.append(num) print ("Data string:", val) print ("Data integer:", num) except ValueError: print('Comma not follwed by integer') counter = 0 print ('%s' % (var.rjust(33))) print ('%12s |%12s' % (heading1.ljust(20), heading2.rjust(23))) print ('---------------------------------------------') for i in range(len(mylist1)): print ('%12s |%12s' % (mylist1[i].ljust(20), mylist2[i].rjust(23)))

Compare output Number of Novels Authored blank blank Input Your output correctly Enter a title for the data: starts with You entered: Number of Novels Authored 2: Compare output Number of Novels Authored Author name Number of novels Input Enter a title for the data: You entered: Number of Novels Authored Your output starts Enter the column 1 header: You entered: Author name with Enter the column 2 header: You entered: Number of novels Ent Enter a title for the data: You entered: Number of Novels Authored Expected output Enter the colunn 1 header: starts with You entered: Author name Enter the column 2 header: You entered: Number of novels 3: Compare outputA 0/4 Number of Novels Authored Author name Input Number of novels Jane Austen, 6 Enter a title for the data: You entered: Number of Novels Authored Enter the column 1 header: You entered: Author name Enter the column 2 header: You entered: Number of novels Enter a data point(-1 to stop input): Data string: Jane Austen Your output starts With Data integer: 6 Ent

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!