Python Forum
Solutions to this questions
Thread Rating:
  • 3 Vote(s) - 3.33 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Solutions to this questions
#8
You should use python code tags to make your code more readable and to keep an indentation right (your third return statement is clearly misindented).

Little problem with your solution is that an empty string is not a string consisting of single space. Evaluation of an empty string is not covered with visible tests, so it is not catched. With that corrected it should work.

You can use len(x) == len(set(x)) for shorter, but maybe less readable check.
Reply


Messages In This Thread
Solutions to this questions - by jerrykatoh - Feb-23-2017, 08:41 AM
RE: Solutions to this questions - by Ofnuts - Feb-23-2017, 09:44 AM
RE: Solutions to this questions - by j.crater - Feb-23-2017, 09:50 AM
RE: Solutions to this questions - by zivoni - Feb-23-2017, 11:59 AM
Solutions to this questions - by jerrykatoh - Feb-23-2017, 08:50 AM
RE: Solutions to this questions - by j.crater - Feb-23-2017, 09:11 AM
RE: Solutions to this questions - by jerrykatoh - Feb-23-2017, 10:25 AM
RE: Solutions to this questions - by merlem - Feb-23-2017, 10:48 AM
RE: Solutions to this questions - by zivoni - Feb-23-2017, 11:07 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Compute complex solutions in quadratic equations liam 1 1,930 Feb-09-2020, 04:18 PM
Last Post: Gribouillis
  More Errors. Less Solutions. SyntaxError123 7 4,957 Mar-30-2017, 07:55 PM
Last Post: micseydel

Forum Jump:

User Panel Messages

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