Python Forum
help comparing strings
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
help comparing strings
#3
Hi @xander ,
Welcome to the forum. It is good you added your code, but please also read how to use BBcode. You have to mark your code and press the "Insert python" button.

But what is your question? Reduce complexity? The code seems quite compact to me. But there are a few things not OK:
  • NEVER use built-in names like in def contain_duplicates(list). "list" is a built-in.
  • The names you use are not very descriptive. For example: "char1" appears to be a word, not a character. "empty=[]" does not remain empty.
Please enhance your code (using BBcode) and we will see if we can make it less complex.
xander and BashBedlam like this post
Reply


Messages In This Thread
help comparing strings - by xander - Dec-28-2021, 10:12 PM
RE: help comparing strings - by Larz60+ - Dec-29-2021, 01:16 AM
RE: help comparing strings - by ibreeden - Dec-29-2021, 09:30 AM
RE: help comparing strings - by BashBedlam - Jan-04-2022, 04:09 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Strings inside other strings - substrings OmarSinno 2 3,753 Oct-06-2017, 09:58 AM
Last Post: gruntfutuk

Forum Jump:

User Panel Messages

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