Python Forum
Making a function more efficient
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Making a function more efficient
#3
Always on the lookout for an interesting challenge, it's been a while.
Would this do ?

uniques = []
for x in range (1,1001):
    lst = list(str(x))
    lst.sort()
    if not lst in uniques:
        uniques.append(lst)
        print(x)
Paul
rob101 likes this post
It is more important to do the right thing, than to do the thing right.(P.Drucker)
Better is the enemy of good. (Montesquieu) = French version for 'kiss'.
Reply


Messages In This Thread
Making a function more efficient - by CatorCanulis - Oct-02-2022, 07:24 AM
RE: Making a function more efficient - by DPaul - Oct-03-2022, 06:00 AM
RE: Making a function more efficient - by DPaul - Oct-04-2022, 07:10 AM
RE: Making a function more efficient - by DPaul - Oct-05-2022, 06:30 AM
RE: Making a function more efficient - by DPaul - Oct-06-2022, 07:47 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  A more efficient code titanif 2 544 Oct-17-2023, 02:07 PM
Last Post: deanhystad
  Cleaning my code to make it more efficient BSDevo 13 1,582 Sep-27-2023, 10:39 PM
Last Post: BSDevo
Question Making a copy list in a function RuyCab 1 1,855 Jul-11-2021, 02:06 PM
Last Post: Yoriz
  Making a code.py file to function, does not run hobbyist 6 2,999 Jan-27-2021, 07:50 AM
Last Post: DeaD_EyE
  I there a more efficient way of printing ? Capitaine_Flam 7 3,639 Dec-01-2020, 10:37 AM
Last Post: buran
  A more efficient way of comparing two images in a python vukan 0 2,062 Mar-17-2020, 11:39 AM
Last Post: vukan
  making a function that writes variables (is possible?) miker2808 3 2,418 Jan-30-2020, 06:27 PM
Last Post: buran
  how to make iterative search more efficient renergy 2 2,314 Jan-03-2020, 03:43 PM
Last Post: stullis
  Simple problem. looking for an efficient way silverchicken24 3 2,409 Oct-14-2019, 07:13 PM
Last Post: Larz60+
  need help with making a validating function drasil 8 3,859 Mar-28-2019, 10:38 AM
Last Post: perfringo

Forum Jump:

User Panel Messages

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