Author: Not specified Language: text
Description: Not specified Timestamp: 2017-08-03 21:03:22 +0000
View raw paste Reply
  1. #!py
  2. string1 = 'A      B         C'
  3. string2 = 'D      E         F'
  4. string3 = 'G      H        I'
  5.  
  6. column = 0
  7.  
  8. while True:
  9.   if string1[column] != ' ':
  10.     char1 = column
  11.     print "First char found at " + str(column) + ' = ' + string1[column]
  12.     break
  13.   column += 1
  14.  
  15. while True:
  16.   if string1[column] == ' ':
  17.     space1 = column
  18.     print "First space found at " + str(column) + ' = ' + string1[column]
  19.     break
  20.   column += 1
  21.  
  22. while True:
  23.   if string1[column] != ' ':
  24.     char2 = column
  25.     print "Second char found at " + str(column) + ' = ' + string1[column]
  26.     break
  27.   column += 1
  28.  
  29. while True:
  30.   if string1[column] == ' ':
  31.     space2 = column
  32.     print "Second space start found at " + str(column) + ' = ' + string1[column]
  33.     break
  34.   column += 1
  35.  
  36. while True:
  37.   if string1[column] != ' ':
  38.     char3 = column
  39.     print "Second char found at " + str(column) + ' = ' + string1[column]
  40.     break
  41.   column += 1
View raw paste Reply