Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
the next higher character
#11
how is it that your answer gives one character that is higher than the one given character? and it is larger than the example i gave. this is where i think you misunderstood because it appears that your answer just prints out a list of characters instead of figuring out which is next higher after a given character.
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply
#12
I know, this is not exactly what you want, but it comes nearby.

#!/usr/bin/python3
import string

#'a'->'b' or '4'->'5' or '9'->'a'
print(string.ascii_lowercase[0 + 1])
print(string.digits[4 + 1])
print(string.printable[9 + 1])
Reply
#13
in what way? are you trying to print a table of ASCII so i can look it up to verify if my code does it correctly? i already verified it. i just thought the code was a little long.
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply
#14
Ok, I understood.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Beginner Higher Lower Game wallytan 2 1,584 Sep-29-2022, 05:14 PM
Last Post: deanhystad
  Regex higher IR library DreamingInsanity 6 2,202 Jun-06-2022, 02:37 PM
Last Post: DreamingInsanity
  [solved] unexpected character after line continuation character paul18fr 4 3,388 Jun-22-2021, 03:22 PM
Last Post: deanhystad
  SyntaxError: unexpected character after line continuation character siteshkumar 2 3,158 Jul-13-2020, 07:05 PM
Last Post: snippsat
  how can i handle "expected a character " type error , when I input no character vivekagrey 2 2,731 Jan-05-2020, 11:50 AM
Last Post: vivekagrey
  finding the next higher representable floating point value Skaperen 0 1,936 Sep-13-2019, 11:16 PM
Last Post: Skaperen
  Replace changing string including uppercase character with lowercase character silfer 11 6,172 Mar-25-2019, 12:54 PM
Last Post: silfer
  SyntaxError: unexpected character after line continuation character Saka 2 18,547 Sep-26-2017, 09:34 AM
Last Post: Saka
  How do I loop through a list and delete numerical elements that are 1 lower/higher? neko 4 4,289 Sep-05-2017, 02:25 PM
Last Post: ichabod801

Forum Jump:

User Panel Messages

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