0

scrutiny and describing code

If possible describe this code especially lines 3,5,9 https://code.sololearn.com/c88mPZNxoYI2/#py

15th Dec 2017, 5:52 AM
NIMA
NIMA - avatar
1 Answer
+ 2
It's simply finding the first letter in the word and cuts off any whitespace before that. It does this by finding the index of the first letter, and initializes a new string to the old string starting from the index. Line 3: initializes index n to... None, i think it's better to make it 0. Line 5: if the index n no longer points to a whitespace Line 9: assign new string to old string starting from index n
15th Dec 2017, 6:09 AM
Echo One
Echo One - avatar