Python Forum
Write a code to output in alphabetical order
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Write a code to output in alphabetical order
#1
hi all i'm new here , i have a problem with my homework here if you can help me to solve it !

Assume s is a string of lower case characters.

Write a program that prints the longest substring of s in which the letters occur in alphabetical order. For example, if s = 'azcbobobegghakl', then your program should print

Longest substring in alphabetical order is: beggh

In the case of ties, print the first substring. For example, if s = 'abcbcd', then your program should print

Longest substring in alphabetical order is: abc
Reply


Messages In This Thread
Write a code to output in alphabetical order - by AbdelaliPython - Jan-19-2018, 08:55 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How to write a dict code in python ariellea88 4 1,078 Oct-31-2023, 08:45 AM
Last Post: buran
  No desired output for code. James349 1 1,038 May-19-2023, 05:43 PM
Last Post: deanhystad
  Padlock of alphabetical strings Men 11 4,133 Aug-06-2022, 07:48 AM
Last Post: mariasmith1122
  how to write code demon_calcifer 1 1,644 Nov-16-2021, 04:09 PM
Last Post: Larz60+
  Can someone please help me write the code Ram 8 3,399 Feb-08-2021, 08:21 AM
Last Post: Serafim
  Please help me to write code for this vij 8 3,821 Jun-10-2020, 12:13 PM
Last Post: pyzyx3qwerty
  Write pseudo code for a class assignment Scrimshot 3 3,438 May-07-2019, 05:38 PM
Last Post: Scrimshot
  In need help to put this code in order lekuru01 4 3,164 Apr-11-2019, 05:50 AM
Last Post: loomski
  Wrong output on my code. JTNA 2 7,961 Apr-04-2019, 01:55 PM
Last Post: JTNA
  Help!! Order form and receipt code beginner1996 2 3,319 Mar-07-2019, 03:22 PM
Last Post: beginner1996

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020