hey guys, i want a code that generates all possible combinations of 5 digit code using python
Generates all possible combinations of 5 digit code using python
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.
hey guys, i want a code that generates all possible combinations of 5 digit code using python
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Rajanikant HawaldarRank #110 · 20.2K reputationPosted Jun 26, 2021, 7:15 AM EDT
Ramesh140 reputationPosted Jun 26, 2021, 7:17 AM EDT
Gurpreet AroraRank #327 · 7.6K reputationPosted Jun 26, 2021, 3:41 PM EDT
def comb(L): for i in range(3): for j in range(3): for k in range(3): # check if the indexes are not # same if (i!=j and j!=k and i!=k): print(L[i], L[j], L[k]) # Driver Code comb([1, 2, 3])or another way to do this
from itertools import permutations
# Get all combination of [1, 2, 3] # of length 3 comb = permutations([1, 2, 3], 3) for i in comb: print(i)