Ok so since this is my daily post I thought I would flesh this out a little bit, with words.
And pictures.
I have posted two other coding posts in the past few days with no other context other than I am learning Python. I must say after going through the curriculum I think I am getting a basic concept of the language.
Gaming IRL.
Yes, I am looking at this from a gaming perspective, after all I love to play games and what better way to level up than to do it for my real life self as opposed to an avatar.
While the course is a hundred day course with the premise of me doing it every single day to ensure I learn this quick I am a slow gamer when it comes to grinding. Fully believing, slow and steady wins the race. Like this avatar above from the game Neverwinter Nights - Arelith server.. I have had this avatar for close to 10 years. In that time I have only really scratched the higher levels. Mainly playing in a role playing capacity with no regard to really advancing in level through grinding in a fast and short period of time.
Have you played Neverwinter Nights?
Preferring instead to take my time. Hence this day five journey has taken me about a month plus. But I am getting there.
Day five really for me some thinking. I have done one Python course before this 100 day one but that was just 36 hours of me just listening to the guy without me trying any of the exercises. They say through practice you will get better. The plan was to listen to it, then redo the course again and do the exercises. But I guess I moved on to this new one instead. Thankful I did since the course forces you to really do the course with the exercises. Nice and short ones just to see if you understand.
#Password Generator Project
import random
letters = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']
numbers = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9']
symbols = ['!', '#', '$', '%', '&', '(', ')', '*', '+']
print("Welcome to the PyPassword Generator!")
nr_letters= int(input("How many letters would you like in your password?\n"))
nr_symbols = int(input(f"How many symbols would you like?\n"))
nr_numbers = int(input(f"How many numbers would you like?\n"))
#Eazy Level - Order not randomised:
#e.g. 4 letter, 2 symbol, 2 number = JduE&!91
#Hard Level - Order of characters randomised:
#e.g. 4 letter, 2 symbol, 2 number = g^2jk8&P
password = []
counter = 0
random.shuffle(letters)
for length in letters:
counter += 1
if counter <= nr_letters:
password += length
counter = 0
random.shuffle(symbols)
for symbol in symbols:
counter += 1
if counter <= nr_symbols:
password += symbol
counter = 0
random.shuffle(numbers)
for number in numbers:
counter += 1
if counter <= nr_numbers:
password += number
random.shuffle(password)
#for passw in password:
# passw = passw + passw
#print(passw)
passw = "".join(password)
print(passw)
I made it work!
Now am not sure if this is an efficient code but it does do its job as you can see from the screenshot above.
What are your plans once you finish this course?
I am not sure at the moment. I am just, like I said doing this for a level up in real life gaming. I hope this will translate into something that I can apply to other things in my day to day life. They say the journey to a thousand miles starts with the first step, so I think I have taken that first step. I think I will finish this in time too since I am finding the exercises appealing since they are short and progressively getting harder but in manageable steps. One of the great draws for it is the statement of the teacher telling me the course is like an open book examine, never hesitate to google and this gels with me.
The question now for me is when I will go do day six.