Mini Python Project Tutorial - Password Generator

แชร์
ฝัง
  • เผยแพร่เมื่อ 7 ก.ย. 2024

ความคิดเห็น • 160

  • @worldanime9884
    @worldanime9884 ปีที่แล้ว +87

    please make more tutorials like this, because tutorials like this can make the logic of a programmer who is just learning python

    • @TechWithTim
      @TechWithTim  ปีที่แล้ว +23

      thats the plan!

    • @dark_red_blood
      @dark_red_blood ปีที่แล้ว

      ​@@TechWithTim 🎉❤

    • @vaclavhanzl8193
      @vaclavhanzl8193 10 หลายเดือนก่อน

      @@TechWithTim How is the plan going?

  • @RyanShappa
    @RyanShappa ปีที่แล้ว +6

    Super awesome tutorial. I took a minute before I watched to think of ways I would do this if it was my own project. I was pleasantly surprised that we thought of the same ways to complete the project!
    Project Ideas:
    1. url shortener
    2. Inventory management system (library, grocery store, etc) with sql and simple front end (tkinter, react, etc.)
    3. Minesweeper or Galaga with Pygame

  • @caioborgonha3900
    @caioborgonha3900 ปีที่แล้ว +2

    This example was supposed to be easy, however it got really interesting when you added the meet_criterian element the way you did it

  • @mannatbhalla6415
    @mannatbhalla6415 11 หลายเดือนก่อน +3

    This helped me with my assessment so much! I am just learning to code and you explained everything so clearly and perfectly!! Would love to keep seeing videos of yours! Thank you so much for this!

  • @pepejas
    @pepejas ปีที่แล้ว +8

    Everything is so well explained. It's incredible. Thank you for your hard work and for releasing these tutorials for free

  • @purplelala2
    @purplelala2 ปีที่แล้ว +1

    Had to rewatch a couple parts to really understand the code. Glad I picked up ur explanations. Great tutorial!!!!!

  • @edisongarcia94
    @edisongarcia94 ปีที่แล้ว +3

    Thanks for another great video. I like how your tutorials are fun, simple and informative.

  • @TimVandeSluisArtist
    @TimVandeSluisArtist 9 หลายเดือนก่อน

    Great tutorial. It took me a little time to see the correlation between the user input changing the default state of has_number and has_special, and how that ultimately influenced what characters the program kept and discarded during the while loop. This tutorial has helped me understand how to break down the 'problem' into much smaller steps. Thanks.

    • @DANTESFAMILY
      @DANTESFAMILY หลายเดือนก่อน

      Hello, how does it work that the loop discard and keep characters. Mine is creating more than 10 chars until it complies with the condition

  • @GiaQnn
    @GiaQnn ปีที่แล้ว +2

    nice project. but I have a problem with generating a password. all works correct I dont have any error but problem is when i answer on last input with has_special...

  • @BaDbOy-wj1ii
    @BaDbOy-wj1ii ปีที่แล้ว +5

    Very simpler form of this project:
    import random
    import string
    letters = string.ascii_letters
    numbers = string.digits
    special_char = string.punctuation
    character = letters
    if numbers:
    character += numbers
    if special_char:
    character += special_char
    password = ""
    len = int(input("Enter the length: "))
    counter = 0
    while counter < len:
    count_pass = random.choice(character)
    password += count_pass
    counter += 1
    print("Your Password is:" , password)
    Leave a like so many people can see it.

    • @nehemydavis461
      @nehemydavis461 8 หลายเดือนก่อน

      I'm sorry if i am wrong, but with that code, isn't there will be bug where there is a possibility for a password to be generated without symbol or number even though the user ask for it?
      So, if i want a password with number, there is a chance that i get a password full of letter because the while loop terminator is only the password length (as long as the minimum length condition fullfiled) which is not what i want.

  • @Jo.o0o
    @Jo.o0o 11 หลายเดือนก่อน

    Only been learning Python for 2 days now and this is the first project I fully understood :) slightly proud of myself

    • @SkyperX97
      @SkyperX97 7 หลายเดือนก่อน

      You are a special breed if you are actually able to "fully undestend" this after just 2 days.

    • @Jo.o0o
      @Jo.o0o 7 หลายเดือนก่อน

      @@SkyperX97 the progress has slowed down a lot now lol. Only felt like a savant for the first couple weeks

  • @Aarnavop
    @Aarnavop 2 หลายเดือนก่อน

    This Python project creates a password generator that allows users to set a minimum length and include numbers and/or special characters.
    Key moments:
    00:15 This video will guide you through creating a beginner-friendly Python project - a password generator, allowing practice of Python skills and learning new concepts. Additionally, the video offers courses on Python and blockchain development for further learning opportunities.
    -The project involves creating a password manager with customizable features like setting a minimum length, including special characters, and numbers for dynamic password generation.
    -The video demonstrates importing modules, defining a function to generate passwords with specified criteria, and organizing characters for password generation.
    -The process of combining characters into a selection for random password generation is explained, ensuring the generated password meets the specified criteria.
    05:17 The video explains how to generate a random password that meets specific criteria by including numbers, special characters, and reaching a minimum length through a loop in Python programming.
    -Explaining the process of adding numbers and special characters to the password string within the loop.
    -Setting up variables like 'PWT' for the password and 'meets criteria' to track if the password meets the specified criteria.
    -Detailing the logic behind updating the 'meets criteria' variable and the approach of starting with 'true' and potentially setting it to 'false' based on conditions.
    10:24 The video explains a password generation function using conditional statements to ensure the password meets specific criteria like having numbers and special characters. It iterates to add characters until the criteria are met, then returns the generated password.
    -Explanation of the conditional statements used to determine if the password meets criteria like having numbers and special characters. It iterates to add characters until the conditions are satisfied.
    -Demonstration of running the password generation function with manual inputs for minimum length, numbers, and special characters. Showing how the function generates passwords meeting the specified criteria.
    15:29 The video demonstrates creating a password generator in Python by taking user inputs for length, including numbers and special characters, then generating and displaying the password. It also addresses a variable naming error and encourages viewers to explore programming and Python further.
    -The process involves converting user inputs to lowercase, checking for specific criteria, generating a password based on the inputs, and displaying the result.
    -An error related to a variable naming issue is identified, explained, corrected, and the program is rerun to demonstrate the fix.
    -The video concludes by suggesting viewers explore programming and Python, offering resources for learning and inviting suggestions for Python projects in the comments.
    Generated by Aarnav Upadhyay

  • @yadavrupesh04
    @yadavrupesh04 ปีที่แล้ว +2

    Hey Tim, there is super extreme edge case where random.choice picks all the characters until the min length criteria is met and we end up with a password without numbers or special characters even though the flags may be True.

  • @murphygreen8484
    @murphygreen8484 ปีที่แล้ว +2

    This is fun, and for beginners, but seems far more complicated than necessary. Why continue trying to make combinations that have all your elements and checking them; when you can ensure it's all there to start with?

  • @abdulhk815
    @abdulhk815 ปีที่แล้ว +1

    Hi there, I believe from the function block line 26 change the value of the variable
    has value at line 18, this variable hold boolean value (T/F).
    Line 30 we update/change the value of meets criteria to True.
    Why we repeat to assign a boolean value "True" to a variable meets criteria at line 32 and 34.

    • @premsinghrathore9691
      @premsinghrathore9691 หลายเดือนก่อน

      Yeah, it looks like you just remove the meets_criteria var and it won't effect the code.

  • @NoobMaster-he8io
    @NoobMaster-he8io ปีที่แล้ว +3

    Line#32 is still incorrect. Contains typo for "meets_criteria"
    I believe because of that typo the code would generate passwords without numbers even if we include numbers in the password.

  • @adamsimmons6876
    @adamsimmons6876 9 หลายเดือนก่อน +1

    I did it! this was my first tiny project! thank you i learned al ot!

  • @yoyonel1808
    @yoyonel1808 ปีที่แล้ว +5

    You don't have really a control on the length of the password generated, it can be (in worst case scenario) : max(len(letters) + len(digits), len(letters) + len(special)) i.e. you can't predict the length of your result password (generated), it's not a good "characteristic" for a security tool ... 🤔

    • @TechWithTim
      @TechWithTim  ปีที่แล้ว +2

      I agree, but this is just for practice

    • @grandparick3176
      @grandparick3176 ปีที่แล้ว

      i wrote the same thing. How should one counter this?

  • @marcelobc2230
    @marcelobc2230 ปีที่แล้ว +1

    if numbers:
    meets_criter (i) a = has_number
    Great job, thanks

    • @rioschala
      @rioschala หลายเดือนก่อน

      Just watched and spotted the same typo.
      Great video BTW.

  • @ExpensiveVitamins
    @ExpensiveVitamins ปีที่แล้ว

    I liked this tutorial, it was easy to follow (i just started learning python). I liked how you explained what you were doing and why. I'd definitely like to follow some other tutorials you create. I also liked how I didn't have to download any extensions to create something.

  • @alimihakeem841
    @alimihakeem841 ปีที่แล้ว

    I really love to always watch your tutorial videos because your explanation is well detailed and understandable. As this would help me in building my programming skills in an efficient way

  • @poboy251
    @poboy251 ปีที่แล้ว +1

    Since I’m the first Tim I hope you see this. I found your videos because of my online CS degree class. Your projects help me build skill because I am struggling a bit with python. There’s so much I don’t understand. Loops are confusing. List and functions don’t make sense. I try to write code for my exercises but I end up going to stack overflow for the answers and it’s never anything I would have though to coding. I have your slot machine game saved to do the walkthrough as a side project and I’ll continue to save more to get some practice in. Thank you for these videos. Currently struggling to build a text based dragon game

    • @SpencerMckenithWilliams
      @SpencerMckenithWilliams ปีที่แล้ว

      Loops can be confusing concept. Are you taking any c#, c++, or any assembly low level languages you use for your CS classes?

    • @poboy251
      @poboy251 ปีที่แล้ว

      @@SpencerMckenithWilliams no i had one intro class that used coral then jumped right into a scripting class using python. I will say I am the most comfortable using python because before I started school I was already familiar with doing very simple things with it. I haven’t used another language yet. I’ve seen them on message boards and python seems to be the most direct and user friendly to me.

    • @SpencerMckenithWilliams
      @SpencerMckenithWilliams ปีที่แล้ว

      _annoying_data_list = [ i * 2 for i in range(9)]
      List comprehension is shorter syntax but this shouldn't seem confusing? I like doing things this way. Its just me.

    • @SpencerMckenithWilliams
      @SpencerMckenithWilliams ปีที่แล้ว

      @@poboy251 python is more user friendly. I went as far to understand how python memory management works to writing my heavier code with the python C-API. It is quite tedious but rewarding. Especially with subclassing and polymorphism. Still learning as I go along lol

    • @poboy251
      @poboy251 ปีที่แล้ว

      @@SpencerMckenithWilliams ok so walk with me on this. I know what you wrote but however I’m not getting it. Does that makes sense. It’s like I can identify your code because I’ve seen it before but as far as creating something like this myself I’m lost. Your “i” is the data you need to pull from the list multiplied by two specifically the 9th entry in the range I think?? Am I correct.

  • @seemelater5056
    @seemelater5056 ปีที่แล้ว +2

    the line 32 "meets_critera" is also should be set to "meets_criteria" right?

  • @GamingGuy256636
    @GamingGuy256636 3 หลายเดือนก่อน

    @Tech With Tim is it possible to turn this into a tool so I can distribute the tool, The reason for asking that is account Hijackers are back on the run I have had things happen to me and took me a while to change all passwords. but I think if people changed there passwords once or twice a month they would be more secure then before I have chosen when testing the code the tented minimum length I said 120, how ever when a password has been generated users could copy the code and save it somewhere so they dont forget the code.

  • @TheDreamer94
    @TheDreamer94 ปีที่แล้ว +1

    hello tim thank you so much for you great way of expelling how to create a website(Python Website Full Tutorial - Flask, Authentication, Databases & More) but I want to add forget password and user in the website how to do so? again thank you for your get and hard work I really appreciate it

    • @TechWithTim
      @TechWithTim  ปีที่แล้ว +1

      Unfortunately wirh flask u need to build that in yourself. However, Django does have it pre built if you want to check out it’s auth system, I have some tutorials!

  • @M4nT1c0R3
    @M4nT1c0R3 ปีที่แล้ว +2

    line 32 also has meets_critera, the same typo. Great video tho

  • @DANTESFAMILY
    @DANTESFAMILY หลายเดือนก่อน

    Hello it was a great tutorial I really engaged with the way it was explained however even though I copied exactly all in the same way I don't get it to work and I don't understand how does it work that the loop discard and keep characters. Mine is creating more than 10 chars until it complies with the condition can someone please help me understand?

  • @nguflavour1886
    @nguflavour1886 ปีที่แล้ว

    Please sir make more of this type of videos, this is really helpful thanks so much.

  • @sakosa8784
    @sakosa8784 8 หลายเดือนก่อน

    This really taught me a lot about python

  • @jadotohovamnic206
    @jadotohovamnic206 ปีที่แล้ว

    thanks for the videos about python for beginners. They help me (total llamas) a lot.

  • @endtropi
    @endtropi ปีที่แล้ว

    Great approach for using boolean! Very useful tutorial ! Thank you and keep on this way!

  • @timbrown3683
    @timbrown3683 ปีที่แล้ว +1

    This is probably a silly question- why do the function inputs change between line 5 and line 43? are numbers and special characters set to true in line 5 just to allow them into the character generation portion of the function?

    • @jhonvicbardos1833
      @jhonvicbardos1833 ปีที่แล้ว

      There are no stupid questions man. We are all here to learn :D. I think the way the function arguments are setup was for manually calling it within the code. Basically, you can remove the default values so since the user is required to input arguments for special characters and numbers. I hope this helps and my explanation was bad. :)

  • @JohnWaithaka-gp6yo
    @JohnWaithaka-gp6yo 3 หลายเดือนก่อน

    I am experiencing a logic error. The min_length, has_number or has_special functions are not running in my code. What can I do to solve this ?

  • @paulinapawlaczek7119
    @paulinapawlaczek7119 2 หลายเดือนก่อน

    Good tutorial but what if someone enters a letter instead of a number in min_len? and when n is allowed in has_number and has_special, the password is not generated from just letters

  • @usamashami11
    @usamashami11 ปีที่แล้ว +2

    Thank you for the amazing tutorial! Loved it, since you used quite some tips which were new to me.
    Just wanna say, Line 32 has also the same variable name spelling mistake.
    Will it affect the working of code?

  • @PA-bu5cs
    @PA-bu5cs 9 หลายเดือนก่อน

    Great work - However I would prefere if you could slow down a little bit :) And maybe explain a little more thorough how each components relates to one another - its kinda trycka for a noooooob like me

  • @pushon10
    @pushon10 ปีที่แล้ว +1

    How do you do error handling for when a user enters something other than a number for min length and print flags for each field?

    • @abdulhk815
      @abdulhk815 ปีที่แล้ว +1

      try:
      min_length = int(input("Enter the minimum length: "))
      has_number = input("Do you want to have numbers (y/n)? ").lower() == "y"
      has_special = input("Do you want to have special characters (y/n)? ").lower() == "y"
      pwd = password_generator(min_length, has_number, has_special)
      print("The generated password is:", pwd)
      except:
      print("Wrong value")

  • @natalicohen997
    @natalicohen997 ปีที่แล้ว +1

    If the random func will not generate number because there are less numbers then letters (if you choose pass len=3 for example) code will loop for ever? Or am I missing something?

  • @alexanderdestro5971
    @alexanderdestro5971 ปีที่แล้ว

    Thank you very much for the best tutorial like this its just a great job, useful, clear and interesting, keep it on!

  • @MysteryMindset636
    @MysteryMindset636 11 หลายเดือนก่อน

    yes bro make more vedios on projects that helps me as a begineer

  • @mattlivingston2192
    @mattlivingston2192 ปีที่แล้ว

    I quite like this method of testing whether the generated password meets multiple criteria.
    I would however, change it ju-ust a little bit.
    Once the password meets the criteria, that's not going to change, is it? There's no need to check if it still meets the criteria after the next character.
    You have a relevant boolean value at hand (meets_criteria) - trust your previous tests and just use *THAT* to check whether you still need to check the password's validity.
    So, I'd change the variable name from "meets_criteria" to "criteria_met" and then put all the code from lines 25 - 34 behind an "if not criteria_met:" statement.

  • @Stephen.c19
    @Stephen.c19 ปีที่แล้ว +1

    there should be another part where it says "do you want to save this password" and then when you type 'y' it saves it into a folder

  • @oakkarmin8833
    @oakkarmin8833 6 หลายเดือนก่อน

    Hi. Please correct me if I'm wrong. On each iteration, only a character will be chosen from random.choice(characters), yes? Since we've set the default value of has_number and has_special to False, wouldn't meets_criteria will always be fault? I mean, for each loop a character generated from random.choice( ) cannot be both number and punctuation and in the loop, meets_criteria = meets_criteria and has_special. Before that line of code, meets_criteria = has_number was written, so if new_char not in digits then meets_criteria will be False, yes? So if new_char in special and has_special = True, since a number wasn't generated from random.choice( ), has_number will be False and meets_criteria = has_number will in turn affect meets_criteria = meets_criteria and has_special. I'm just really curious and wanted to know. I'm a beginner at Python with no prior programming experience. Your clarification would be very very much appreciated !!

  • @sauraabh
    @sauraabh ปีที่แล้ว

    Thank you for this!! After this series of mini projects is done, can you please also bring some new interesting django project tutorial?

  • @Roland-nx4jk
    @Roland-nx4jk ปีที่แล้ว

    Please I can't see the text in the tutorial well unlike the quiz game and others in the previous lessons

  • @snowin5797
    @snowin5797 ปีที่แล้ว

    Hi tim. I have a question . Can we have an AI that learn games and act as a personality test. Like when someone play a game , the AI understand his behavior in the videogame and give results of his personality. If yes , what should we learn in programming to do this ?

  • @bereck7735
    @bereck7735 ปีที่แล้ว +11

    Atleast this code is better than a lot of other password generator videos I have seen?, props to you for that, but why would you use random, its not a cryptographically safe random number generator, if you used secrets that would be better.

    • @TechWithTim
      @TechWithTim  ปีที่แล้ว +2

      It’s just for a quick practice project!

    • @bereck7735
      @bereck7735 ปีที่แล้ว +1

      @@TechWithTim still it would be better if you secrets tbh, that would also promote the good way to create a password gen, still a good video nontheless

    • @mistious.8332
      @mistious.8332 ปีที่แล้ว

      hes using special characters not only numbers?

    • @bereck7735
      @bereck7735 ปีที่แล้ว +2

      @@mistious.8332 well yes, but that isnt the issue, the random module uses a psuedorandom number generator algorithm which is not cryptographically secure ( Mersenne's Twister ) and can be exploited

    • @nonetype66
      @nonetype66 ปีที่แล้ว

      @@bereck7735 this is a good point! But I think this video is for coding practice for beginners. Not cyber security professionals.
      I don’t think the average python beginner is thinking about or worried about how exploitable this password generator is while learning the syntax.

  • @viktorkovacs9680
    @viktorkovacs9680 ปีที่แล้ว +1

    Great video, although there is still a bug left in it.

  • @cherryblossoms5970
    @cherryblossoms5970 10 หลายเดือนก่อน

    17:56 in if number condition body that spelling is incorrect so how it didn't give you error ? But you fixed the special character body.
    Sorry its only one month passed I'm learning python with the help of youtube.

  • @gnlchannel3497
    @gnlchannel3497 ปีที่แล้ว

    hello when i tried this everything worked out well but whenever i said yes to numbers but no to special characters it said that my password was none

  • @zadduvaripallijagadeeshkum6843
    @zadduvaripallijagadeeshkum6843 ปีที่แล้ว

    in line 30, why cant we just write meets_criteria = has_number and has_special ?

  • @0xHydra
    @0xHydra ปีที่แล้ว

    Why do you need to set meets_criteria to True before validating with the conditional statements?
    Whether it starts as True or False, it'll be set to the right Boolean value after the conditional statements no?

  • @TomasSchertel
    @TomasSchertel ปีที่แล้ว +1

    Which vscode extensions do you have there?
    I'd like to have keywords in italic too.

    • @mydolls6004
      @mydolls6004 ปีที่แล้ว

      I think it's the default one

    • @TomasSchertel
      @TomasSchertel ปีที่แล้ว

      @@mydolls6004 any thoughts on how to configure it?

  • @nbagaming1873
    @nbagaming1873 ปีที่แล้ว

    why you use meet_critera in the line 32 and the code still work? Because it does not match what you are explain.

  • @deborahbopeya8150
    @deborahbopeya8150 9 หลายเดือนก่อน

    Thank you so much ❤ you are a big help

  • @philippedid
    @philippedid 7 หลายเดือนก่อน

    hello Tim! can't we simplified those if/else with a dictionary ?

    • @TechWithTim
      @TechWithTim  7 หลายเดือนก่อน

      Sure but his was just meant for beginners!

  • @KayderimGameplays
    @KayderimGameplays ปีที่แล้ว

    Hey tim, are you using VScode? If so, what is the theme you are using?

  • @Hui1314
    @Hui1314 ปีที่แล้ว

    What if the criteria is to have a fixed length of password characters?

  • @ToSSpec
    @ToSSpec 11 หลายเดือนก่อน +1

    On the password print i get name "pwd" is not defined

    • @ToSSpec
      @ToSSpec 11 หลายเดือนก่อน +1

      Found out how to fix it

  • @MustafaDahbest
    @MustafaDahbest ปีที่แล้ว

    Hello everybody, how can we save this password .txt file?
    I searched google but can't resolve.
    I was able to try this:
    with open("Password", "w") as f:
    f.write("pwd")

  • @colevano
    @colevano ปีที่แล้ว +2

    This is cool, but it is *not* secure. The normal Python random library is not designed for security or cryptography, so don't use this to make your real passwords.

    • @TechWithTim
      @TechWithTim  ปีที่แล้ว +1

      For sure I didn’t say it was secure! Just for practice

  • @waipalisrevenge3707
    @waipalisrevenge3707 ปีที่แล้ว

    i agree , that's a very good idea of you , keep up the good work ::

  • @user-sk7yu8bx9b
    @user-sk7yu8bx9b ปีที่แล้ว

    can you tell me how many members can do this project

  • @lsaikumar4003
    @lsaikumar4003 ปีที่แล้ว

    Hi Tim,, Can you please check the line number 25 to 28., I think the second elif will not be executed. Correct me if I'm wrong. Thanks

    • @nehemydavis461
      @nehemydavis461 8 หลายเดือนก่อน +1

      I think line 25-28 works just fine. It checks every new character whether it is a letter, digit, or special chars.
      If the new char is a digit then the first if will become true and has_numbers will be true thus we know that the password at least has a digit.
      If it not a digit, then the first if will be false, and second elif will be checked, and if it is indeed a special char then has_special will be true thus we know that the password already has at least 1 special char.
      if the new char is a letter, then we don't really care, because we just want to make sure the password meets the criteria and has minimum length of password. cmiiw 👍

    • @lsaikumar4003
      @lsaikumar4003 8 หลายเดือนก่อน

      @@nehemydavis461 Thanks for clarifying

  • @alexalexander1471
    @alexalexander1471 ปีที่แล้ว

    make a tutorial how to make a game of rock paper scissors and as short code as you can

  • @non5309
    @non5309 ปีที่แล้ว

    это наверное для начинающих совсем совсем начинающих, потому-что код явно излишний, плюс не хватает банальных проверок типа длина не может быть меньше 3 если все опции включены, ну и тому подобное.

    • @TechWithTim
      @TechWithTim  ปีที่แล้ว

      It is designed for beginners, just a quick little example program

  • @avanichaudhary4806
    @avanichaudhary4806 7 หลายเดือนก่อน

    can i add this in my resume?

  • @teju4443
    @teju4443 10 หลายเดือนก่อน

    In which software did you implement this code

    • @unitnuity
      @unitnuity 8 หลายเดือนก่อน

      Visual Studio Code

  • @binyameenpehlari7419
    @binyameenpehlari7419 ปีที่แล้ว

    interesting series

  • @user-xu6pq5sx7z
    @user-xu6pq5sx7z ปีที่แล้ว

    Hi Tim,
    I've completed the code and when i put a minimum length of any number, the password generated is a 1 digit password. Do you know how to fix this?

    • @michaeldunn302
      @michaeldunn302 ปีที่แล้ว

      Same problem here, code is the same, any time I try to generate the pwd regardless of the min length entered it only kicks back a one digit response

    • @unitnuity
      @unitnuity 8 หลายเดือนก่อน

      You guys probably fixed it but just incase, make sure you don't still have the generate_password(10) call that was replaced later in the video. Its always gonna limit to 10 or whatever you have for the parameter.

  • @LuizHenrique-xb3py
    @LuizHenrique-xb3py 11 หลายเดือนก่อน

    I made a code to make the password even more random
    while len(pwd) < length:
    new_letter = random.choice(letters)
    new_number = random.choice(numbers)
    new_symbol = random.choice(symbols)
    choice = random.randint(0,3)
    if choice == 1 and has_letters:
    pwd += new_letter
    elif choice == 2:
    pwd += new_number
    elif choice == 3 and has_symbols:
    pwd += new_symbol

    return pwd
    it generates a random number and based on the number adds either a letter number or a symbol, based on if the user wants or not those in the code. hope it helps someone

  • @user-mi2bb8bm6s
    @user-mi2bb8bm6s ปีที่แล้ว

    meets_criteria = True
    if (needs_number and not has_number) or
    (needs_special and not has_special):
    meets_criteria = False

  • @TheDreamer94
    @TheDreamer94 ปีที่แล้ว

    Thanks!

  • @raJeshraOte14
    @raJeshraOte14 ปีที่แล้ว

    pls make oop videos on python flet or pynecone framework

  • @Harinissri
    @Harinissri ปีที่แล้ว

    Bro can I add this mini project in my resume????

  • @jiggabyte
    @jiggabyte 5 หลายเดือนก่อน

    you still have another error on meet_critera

  • @360worldvision4
    @360worldvision4 7 หลายเดือนก่อน

    Do he is using VS CODE?

  • @ahmehhhd
    @ahmehhhd ปีที่แล้ว

    JESSE? WHAT ARE YOU DOING ON YT WE NEED TO COOK!!!

  • @pwomp9348
    @pwomp9348 ปีที่แล้ว

    nice

  • @GamesindieSR
    @GamesindieSR ปีที่แล้ว

    Seems much longer code and many variables.

  • @jfmjaco5941
    @jfmjaco5941 9 หลายเดือนก่อน

    You need a max numbe

  • @zaidtabish1996
    @zaidtabish1996 ปีที่แล้ว

    🥇

  • @renlog7755
    @renlog7755 ปีที่แล้ว

    import os
    print(os.urandom(7))

    • @TechWithTim
      @TechWithTim  ปีที่แล้ว +1

      shhh, this is for practice

    • @usamashami11
      @usamashami11 ปีที่แล้ว

      @@TechWithTim 😂

    • @renlog7755
      @renlog7755 ปีที่แล้ว

      @@TechWithTim lolz

  • @mrxinnovations809
    @mrxinnovations809 ปีที่แล้ว

    Hello world

  • @viktorivailov8115
    @viktorivailov8115 ปีที่แล้ว

    1st

  • @Dabber7
    @Dabber7 ปีที่แล้ว

    Please speak slowly Bro

  • @SubDogWater
    @SubDogWater ปีที่แล้ว

    This project again didn't work for me. :(

    • @prashantdas3618
      @prashantdas3618 ปีที่แล้ว

      for a shorter version, tell me your email id

    • @SubDogWater
      @SubDogWater ปีที่แล้ว

      why do you need my email?

    • @grandparick3176
      @grandparick3176 ปีที่แล้ว

      @@SubDogWater he will try to scam you. don't give it.

    • @SubDogWater
      @SubDogWater ปีที่แล้ว

      @@grandparick3176 I know i just wanted to see what kind of an idiot he is

    • @prashantdas3618
      @prashantdas3618 ปีที่แล้ว

      @@SubDogWater : "Quote" for a shorter version... "Unquote". TH-cam won't let me write programming code in the comment section

  • @grandparick3176
    @grandparick3176 ปีที่แล้ว

    There is one problem, that is the password length is higher than the one user has chosen sometimes.

  • @meryouti293
    @meryouti293 3 หลายเดือนก่อน

    import random
    import string
    def generate_password(length= 26):
    # Define the character sets to use in the password
    letters = string.ascii_letters # 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
    digits = string.digits # '0123456789'
    symbols = string.punctuation # '!@#$%^&*()_+[]{}|;:,.?'
    # Combine all the character sets
    all_characters = letters + digits + symbols
    # Ensure the password has at least one letter, one digit, and one symbol
    password = [
    random.choice(letters),
    random.choice(digits),
    random.choice(symbols)
    ]
    # Fill the rest of the password length with random characters from all_characters
    password += random.choices(all_characters, k=length - 3)
    # Shuffle the characters to ensure the random order
    random.shuffle(password)
    # Convert the list to a string and return it
    return ''.join(password)
    # Generate a random password with the default length of 12
    print("Generated password:", generate_password())

  • @nehemydavis461
    @nehemydavis461 8 หลายเดือนก่อน

    you actually still has the "meets_critera" typo without 'i' in line 32. Because of that even if you don't want numbers, it still shows up just like your last test after fixing the same other typo. That makes me wondering, if in cpp or something that needs to initialize a variable with the data types first, then that typo will become an error which will notice me, but with python that typo is not an error, but a bug that could go unnoticed, how do i prevent this unnoticing typo that become bug in python? Thanks! great tutorial 👍