I'm new to programming and currently in school. I'm having an issue with an assignment where I need to create a loop for multiple inputs until the user enters q to end. Now this question as a whole assignment has been asked before linked here Trying to hammer out this zylabs Lab but struggling and I have been following @Splatmistro list to complete the assignment for the most part. But, I only need help to understand what is missing from my code to work correctly.
input_comma = input('Enter input string: \n')
**if input_comma != 'q':**
while ',' not in input_comma:
print('Error: No comma in string.')
input_comma = input()
print('Enter input string: ')
split_input = input_comma.split(',')
print('First word:',split_input[0].strip())
print('Second word:',split_input[1].strip())
I know I need an IF statement before the while statement but the one I have doesn't seem to be working. I know I missing something but I just can't figure it out. Any help would greatly be appreciated.
EDITED: This is the intended output of the code im working on.
Enter input string: Jill, Allen
First word: Jill
Second word: Allen
Enter input string: Golden , Monkey
First word: Golden
Second word: Monkey
Enter input string: Washington,DC
First word: Washington
Second word: DC
Enter input string: q
My code will take and print the first input correctly but it will not proceed to loop for a 2nd, 3rd, or 4th input. This is what I was asking for help with.