omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    Password Generator having issues

    Pythonista
    generators password
    2
    2
    736
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Trouper
      Trouper last edited by

      I'm very new to python and need to create a password generator (for school) containing upper, lower cases, numbers and characters and at least 8 characters in length, and give the user 4 options to choose from. Ive wasted a few days now trying lots of different thingd and cant quite get this concept to work for me.
      Can anyone please point me in the right direction? It'd be very much appreciated. Thanks!

      1 Reply Last reply Reply Quote 0
      • ccc
        ccc last edited by ccc

        https://github.com/TheAlgorithms/Python/blob/master/other/password_generator.py

        from random import choice
        from string import ascii_letters, digits  #, punctuation
        chars = ascii_letters + digits  # + punctuation
        length = 8  # 8 is really too short for the state of computers in 2021!
        for number_of_passwords in range(4):
            print("".join(choice(chars) for x in range(length)))
        
        1 Reply Last reply Reply Quote 0
        • First post
          Last post
        Powered by NodeBB Forums | Contributors