Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
HELP ME
#1
I wrote the code, but each digit with 3 digits could not reflect a different 4 permutation please help.

def comb(L): 
      
    for i in range(3): 
        for j in range(3): 
            for k in range(3): 
                  
              
                if (i!=j and j!=k and i!=k): 
                    print(L[i], L[j], L[k]) 
                      

comb([1, 2, 3, 4])
Larz60+ write Nov-23-2020, 03:58 PM:
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.

Fixed for you this time. Please use bbcode tags on future posts.
Reply


Messages In This Thread
HELP ME - by sabe - Nov-23-2020, 10:58 AM
RE: HELP ME - by Superjoe - Nov-23-2020, 04:36 PM
RE: HELP ME - by deanhystad - Nov-23-2020, 09:46 PM

Forum Jump:

User Panel Messages

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