#🔒 Help me to improve my code

36 messages · Page 1 of 1 (latest)

abstract apexBOT
#

@left salmon

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

left salmon
#

import time

Liste de tous les caractères possibles

all_characters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~ '

Fonction pour générer des combinaisons

def generate_combinations():
output = ''
length = 0

while True:
    for char1 in all_characters:
        for char2 in all_characters:
            for char3 in all_characters:
                for char4 in all_characters:
                    for char5 in all_characters:
                        for char6 in all_characters:
                            for char7 in all_characters:
                                for char8 in all_characters:
                                    for char9 in all_characters:
                                        for char10 in all_characters:
                                            output += char1 + char2 + char3 + char4 + char5 + char6 + char7 + char8 + char9 + char10
                                            length += 10
                                            
                                            if length >= 10:
                                                print(output)
                                                output = ''
                                                length = 0
                                                time.sleep(0)  # Attendre 2 secondes

Appel de la fonction pour générer des combinaisons infinies

generate_combinations()

#

this is my code

rain cloud
#

please use

#

!code

abstract apexBOT
#
Formatting code on Discord

Here's how to format Python code on Discord:

```py
print('Hello world!')
```

These are backticks, not quotes. Check this out if you can't find the backtick key.

For long code samples, you can use our pastebin.

left salmon
#

!code

icy solstice
#

Hi

#

What's the aim of this function?

left salmon
#

brute force

icy solstice
#

Brute force what?

#

Password combinations or something?

left salmon
#

i want he show me the password

#

and be faster

icy solstice
left salmon
#

no

icy solstice
#

Brute force attacks are by nature very slow

left salmon
#

i will usit for randomatation

shut blade
#

use itertools.product

left salmon
#

/itertools.product

shut blade
#

!d itertools.product

abstract apexBOT
#

itertools.product(*iterables, repeat=1)```
Cartesian product of input iterables.

Roughly equivalent to nested for-loops in a generator expression. For example, `product(A, B)` returns the same as `((x,y) for x in A for y in B)`.

The nested loops cycle like an odometer with the rightmost element advancing on every iteration. This pattern creates a lexicographic ordering so that if the input’s iterables are sorted, the product tuples are emitted in sorted order.

To compute the product of an iterable with itself, specify the number of repetitions with the optional *repeat* keyword argument. For example, `product(A, repeat=4)` means the same as `product(A, A, A, A)`.
left salmon
shut blade
#

!e

from itertools import product
chars = "abc"

for char1, char2, char3 in product(chars, repeat=3):
  print(char1, char2, char3)
abstract apexBOT
#

@shut blade :white_check_mark: Your 3.12 eval job has completed with return code 0.

001 | a a a
002 | a a b
003 | a a c
004 | a b a
005 | a b b
006 | a b c
007 | a c a
008 | a c b
009 | a c c
010 | b a a
011 | b a b
... (truncated - too many lines)

Full output: https://paste.pythondiscord.com/OTSRO6ONWWOCDHAWJ4MXGCZKTQ

shut blade
#

if C is the input set, then this returns the cartesian product set C^n where n is the repeat

shut blade
#

yes, but it's built into python

#

you don't have to install anything

left salmon
#

oh i will test it

#

its worked

#

i wanna creat an machine learning it s OBLIGATORY to use an library

abstract apexBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.