Day five can be tricky but with perseverance. You will get there, eventually.

in HiveCoding2 years ago

Ok so since this is my daily post I thought I would flesh this out a little bit, with words.

And pictures.

image.png

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.

image.png

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.

image.png

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.

Browse merch here.


Click Image

Geomining to a better future referral link if you decide to support me

Click Image

bitcoin public wallet.png

Click Image

Shameless referral link to space game

Sort:  

Tsc tsc being lazy even to create a password?? lol thanks for the post. Neverwinter is a wonderful game btw

!1UP

You can earn passive income by delegation of tribe tokens to "The Cartel".

dlmmqb-TheCartel-banner
Click this banner to join "The Cartel" discord server to know more.

Hell yeah, NWN is a cult classic IMO.

1UP-PIZZA.png

You have received a 1UP from @gwajnberg!

The @oneup-cartel will soon upvote you with:
@stem-curator, @vyb-curator, @pob-curator, @neoxag-curator
And they will bring !PIZZA 🍕.

Learn more about our delegation service to earn daily rewards. Join the Cartel on Discord.

It remind me of coding back in 90's when I had to code in BASIC language in my college days.

I think Python is quite easy to code than any other type of coding language.

!PIZZA

PIZZA! PIZZA! PIZZA!

PIZZA Holders sent $PIZZA tips in this post's comments:
curation-cartel tipped akumagai (x1)
@wittyzell(1/10) tipped @akumagai (x1)
emaxisonline tipped akumagai (x1)

You can now send $PIZZA tips in Discord via tip.cc!

I think the password generator is a great project to begin with.
Your code seems fine.
Although it can be improved.
You might want to check on range() to create the numbers for you instead of adding it 1 by 1. I think you could also use this function for generating A-Za-z. You could play around that. 😄
And it would also be a good practice to have a default number if user don't wanna input their choice.
Just my thoughts, feel free not to follow my opinion. LOL

!PIZZA great work! I might try that python course soon. I only know how to read the code and never actually writing one from scratch. LOL

Thanks for the feedback. I'll see if I can implement it lol

Dear @akumagai, sorry to jump in a bit off topic but may I ask you to support the HiveSQL proposal?
It lost its funding recently and your help would be much appreciated to keep the HiveSQL service free for the Hive community.
You can do it on Peakd, Ecency,

Hive.blog / https://wallet.hive.blog/proposals
or using HiveSigner.

Thank you for your support!

Sure thing man, no probs.

Thank you for your support @akumagai, really appreciate it! 👍

That's some solid motivation right there.

I have seen those IoT units you can program to do all sorts of interactions with sensors and can even act as a hive relay of sorts. And yes I think from memory it uses Python as its language.