Best writers. Best papers. Let professionals take care of your academic papers

Order a similar paper and get 15% discount on your first order with us
Use the following coupon "FIRST15"
ORDER NOW

zybooks, parsing strings.

Ok guys, I’m having trouble with my code in zybooks, parsing strings.. I have passed 5/ 7 but don’ t know what’s wrong now.. Here’s my code:

while True:

  string1 = input(‘Enter input string: n’)

  if (string1 == ‘q’):

    break;

  if ‘,’ not in string1:

    print(‘Error: No comma in string.’)

  elif ‘ ‘ not in string1:

    print(‘Error: No comma in string.’)

  elif ‘ ‘ in string1:

    print(‘Error: No comma in string.’)

Screen Shot 2018-10-03 at 8.06.58 AM.png

  else:

    first_word, second_word = string1.split(‘,’)

    first_word, second_word = first_word.strip(), second_word.strip()

    print(‘First word:’, first_word)

    print(‘Second word:’, second_word)

    print()

    print() ATTACHMENT PREVIEW

 
Looking for a Similar Assignment? Order now and Get 10% Discount! Use Coupon Code "Newclient"