Question: Code is wrong: python parsing warm up. while(True): inp_str = input('Enter input string: ') if (inp_str == 'q'): break; while inp_str.find(,)==-1: print('Error: No comma in
Code is wrong: python parsing warm up.
while(True):
inp_str = input('Enter input string: ')
if (inp_str == 'q'): break;
while inp_str.find(",")==-1: print('Error: No comma in string. ') inp_str=input('Enter input string: ') s=inp_str.split(",") print('First word:'+ s[0].strip()) print('Second word:'+ s[1].strip()) print(' ')
This is my code for a problem but the output is wrong and I dont know how to fix it (the top is the output im getting the bottom is what i am supposed to get)
Enter input string: Error: No comma in string. Enter input string: Error: No comma in string. Enter input string: Error: No comma in string. Enter input string: Error: No comma in string. Enter input string: Traceback (most recent call last):
Expected output starts with
Enter input string:
Error: No comma in string.
Enter input string:
Error: No comma in string.
Enter input string:
Error: No comma in string.
Enter input string:
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
