Challenge #1

--Originally published at Programming

For those of you who already feel comfortable using Python I’d like to post a set of different challenging problems that involve all of the mastery topics we’ve covered so far. You can find the solution of these problems online,  but I encourage you to try and code them so you can start combining the mastery topics you’ve been studying and to start thinking as a computer scientist.

Challenge

Assuming that you have any string. Write a program that prints the longest substring of your string in which the letters occur in alphabetical order.

Example:

if str = “agdgijkab”, your program should print: Longest substring in alphabetical order: dgijk

Hint: “a” < “b”