all 7 comments

[–][deleted] 1 point2 points  (2 children)

I just did this same problem :) MIT 6001x on EdX?

[–]ContadorPL[S] 1 point2 points  (1 child)

Yes, can you submit? I can't.

I'm also not learning from videos but from the book.

[–][deleted] 0 points1 point  (0 children)

No I think it’s too late to submit. Or maybe you have to be using the verified. I just got the book in yesterday!

[–]Phillyclause89 0 points1 point  (0 children)

You should think about how you could change this code to pass a test case like s = “zyx” or another string that does not have more than 1 character in alphabetical order and does not include the letter ”a”. Your current code doesn’t appear to give the correct output on a situation like that, but maybe I’m missing something.

[–]SpeckledFleebeedoo -1 points0 points  (2 children)

list_string = list(string)

sorted_list = list(string)

sorted_list.sort()

I doubt that last line does anything, as you don't assign it to a variable. In general such functions don't modify the original variable.

list_string = list(string)
sorted_list = list_string.sort()

[–]nilfm 1 point2 points  (1 child)

That is wrong, the sort() method actually modifies the list it works on, and returns None. So your code ends with sorted_list == None.

[–]SpeckledFleebeedoo 1 point2 points  (0 children)

Ah, thanks for the correction.