Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
bug in my code
#1
when i run the code on my laptop it runs fine. but when i try to submit online it detects a bug with online Type Error  . what can i do to correct the code. the code is suppose to check for isogram, raise a typeerror if non string input is supplied and also return a false if an empty string is entered .
my code 


def is_isogram (saw):
  cat = str(saw)
  while True:
    if len(cat) < 1 :
      return ("(argument, False)")
    elif not cat.isalpha():
      raise TypeError ("\'Argument should be a string'")
    else:
      for me in cat:
        cat = cat.lower()
        if cat.count(me) > 1:
          return (cat, False)
      return (cat, True)
Reply


Messages In This Thread
bug in my code - by sunnysude - Feb-03-2017, 08:42 PM
RE: bug in my code - by nilamo - Feb-03-2017, 09:05 PM
RE: bug in my code - by sunnysude - Feb-05-2017, 12:29 PM
RE: bug in my code - by Ofnuts - Feb-03-2017, 09:12 PM
RE: bug in my code - by sunnysude - Feb-05-2017, 12:27 PM
RE: bug in my code - by Larz60+ - Feb-05-2017, 12:29 PM
RE: bug in my code - by sparkz_alot - Feb-05-2017, 02:58 PM
RE: bug in my code - by sunnysude - Feb-05-2017, 10:50 PM

Forum Jump:

User Panel Messages

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