Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to make a word from the given characters and not duplicated words?

I want to make a word contain 3 characters only and no words duplicated

import requests, random
from colorama import Fore

while True:
    
    usr = ""

    for charachter in random.choices("abcdefghijklmnopqrstvwxyz1234567890"):
        user = usr+ charachter

    response = requests.get(f"https://www.instagram.com/{user}/")

    if (response.status_code == 200):
        print(Fore.RED + "Taken: " + Fore.BLUE + user)
    elif(response.status_code == 400):
        print(Fore.GREEN + "Avilable User: "+ Fore.BLUE +user)

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

try this:


import requests, random
from colorama import Fore

while True:
    usr = ""
    for i in range(3):
        while True:
            charachter = random.choices("abcdefghijklmnopqrstvwxyz1234567890")
            if str(charachter[-1]) not in usr:
                usr += str(charachter[-1])
                break

    response = requests.get(f"https://www.instagram.com/{usr}/")

    if (response.status_code == 200):
        print(Fore.RED + "Taken: " + Fore.BLUE + usr)
    elif(response.status_code == 400):
        print(Fore.GREEN + "Avilable User: "+ Fore.BLUE +usr)     


Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading