Hi this is my first post. I am working on homework for my Python course. I have my code nearly complete, however I am having an issue with a line break. I have three pictures showing my results when I submit for the grade. My theory is this is an issue with my loop and that I will need to add a break or change the structure somehow. If you could please also point me in the right direction and not give me the answer for free it would be appreciated. Thank you very much.
https://i.sstatic.net/812uv.jpg https://i.sstatic.net/bbTfp.jpg https://i.sstatic.net/kV3Z6.jpg
I also have my code below:
string = input('Enter input string: ')
while string != 'q':
if ',' not in string:
print('\nError: No comma in string.')
else:
string = string.replace(' ','')
string_parts = string.split(',')
print('\nFirst word: %s' % string_parts[0])
print('Second word: %s' % string_parts[1])
user_input= input('Enter input string: ')
string = user_input
print(). Try putting one or more of those in places where your instructor wants to see spaces in the output.