+ 1
string comparison
wrote this code to print the words that starts with letters greater than "g" but i keep getting an index error. what is the best way to resolve this https://code.sololearn.com/crM85XC69n2x/?ref=app
3 Answers
+ 1
This may meet your need.
https://code.sololearn.com/cV9k5nvu7zBN/?ref=app
+ 1
whao! that way shorter and neater
+ 1
but do you know why it gives the error, given that i used the same condition like you did, if var[index] > "g". just curious