Python Practicing Again

avatar

Hi fellow Programmers,

I'm trying to get back onto the wagon with learning how to code with Python!

87371531-99D9-44FF-A50F-487C484890F4.png

Hive Divider Bar Text.png

Dusting Off

One of the things that I've had to put on the back burner for a little while was learning how to code with Python. I was doing pretty good for a while, getting in some coding learning every day or so but due to some recent events I fell off the wagon and had to put the education down. Thankfully, recently I've committed to getting back into it! I'm still getting the wheels back to spinning, oiling the joints up again.

87371531-99D9-44FF-A50F-487C484890F4.png

Some of the websites and apps I'm using to learn this stuff is Hacker Rank and SoloLearn. Hacker Rank is one that seems to be more technically challenging, it's pretty interesting to use it. SoloLearn is an excellent app to use and it's got a lot of built in functionality and great things to use to help learn.

The tools to learn are accessible in so many places that it's a little tricky to narrow it down to what is good and what isn't. What's helpful and what's not. I'm looking forward to getting back into learning this stuff, it's not easy and I think with time, I can get pretty good at it.

One thing I'm trying to figure out is how to usefully put to practice what I'm doing. One of the best ways for me to learn something is to physically do it and figure out what I can do to put my learning into practice.

How do you take your programming learning and put it into practice? I would love to learn what others are using and doing to learn languages!

So far I've found some websites that are additional to what I'm doing

https://www.practicepython.org/
https://www.dataquest.io/blog/python-practice/

Using one of the websites, I got to a fun one that listed some projects to play around with. It helps to do this type of stuff because the more we do, the more we can learn! The one I was playing around with here was a random password generator. Not the most complicated stuff and I'm not too familiar with ASCII but I think I fared pretty well! The thing was built with uppercaseLetter1 and 2 only, the rest I was tasked with creating.

import random

#A function do shuffle all the characters of a string
def shuffle(string):
  tempList = list(string)
  random.shuffle(tempList)
  return ''.join(tempList)

#Main program starts here
uppercaseLetter1=chr(random.randint(65,90)) #Generate a random Uppercase letter (based on ASCII code)
uppercaseLetter2=chr(random.randint(65,90))#Generate a random Uppercase letter (based on ASCII code)
lowercaseLetter1 = chr(random.randint(97,122))
lowercaseLetter2 = chr(random.randint(97,122))
digit1 = chr(random.randint(48,57))
uppercaseLetter3=chr(random.randint(65,90))
#Generate more characters here
#....

#Generate password using all the characters, in random order
password = uppercaseLetter1 + uppercaseLetter2 + lowercaseLetter1 + lowercaseLetter2 + digit1 + uppercaseLetter3 # + ....
password = shuffle(password)

#Ouput
print(password)

It was fun to play around with it and to also get more used to Markdown writing this post, I always wondered how folks were inserting lines of code into a post without screwing it up lol the three apostrophe looking things next to the number 1 on the keyboard seems to be the way!

Hive Divider Bar Centered.png

Connect with me!

Do you want to get paid, in crypto, for searching the internet? Try using and signing up for Presearch to earn some great crypto! I've currently got 2,470 PRE tokens, with a market value of $59.28. It doesn't sound like a lot but when you search using sites like Google you get paid $0! Join Presearch to break Google's stranglehold on the internet searches. If you'd like to sign up, use my referral link!
https://www.presearch.org/signup?rid=513043


Image source



0
0
0.000
12 comments
avatar

You lost me at Fellow Coders and better you than me but I love technology and learning.

Been talking to I/T and coder friends who are leveraging AI to do more than they could before. By delegating some of the heavy lifting and spending time on the finer points, some of them just love it.

I would try prompting chatgpt with your lessons to see how well it does and learn how to leverage that while you are learning.

Sounds like you are back in coding shape already!

0
0
0.000
avatar

Yeah I was considering on using one of those at some point but I'm on the fence with it.. it can be a helpful tool but where do we draw the line? Hard to say!

I think what I would rather do, which I've seen one person has done it already, is getting all of the data associated with it locally on a computer of some kind and then run the queries from there. I think that would make me feel a little bit better about it. I can feed data into it but also not be a product of their data selling mechanism. Might be me just being weird but I'd rather not sell any more of my data for free lol.

0
0
0.000
avatar

Uppercase Letter and lower case letters could be their own functions, called in a loop to generate passwords of differing lengths based on user input.

You want to try and avoid writing the same line of code more than once, it makes it much cleaner :)

0
0
0.000
avatar

Yeah I know there's a lot of structural things that need to be refined over time but I think for me, I'm about getting something under my belt for now and I'll refine as I can. I appreciate the tip and feedback! It's a fun journey and one that may bear fruit in the future but when I started this a few years ago I wouldn't have guessed that AI could write code for us lol. It's wild to think of!

One thing for me that's cool after getting to these points is being able to read a bunch of lines of code and have a rough idea of what it's supposed to do!

0
0
0.000
avatar

I'm only about 8-9 months into writing Python, so I'm no expert by any stretch of the imagination. I mainly use it for data analysis and data cleaning.

0
0
0.000
avatar

Yeah that’s one of the other fun things about Python for me as well! I, for work, ended up getting pretty good at data analytics stuff having access to a data lake at work so I got pretty good at SQL queries to figure out what I could get but also excel and other things.

With Python I originally was getting into it for trying to code a game or something but then saw it was really helpful for analytics so I figured what the hell it can’t hurt to use it for a few things!

0
0
0.000
avatar

We mostly use Power Query at work, with a bunch of SQL to get things off the databases into Power BI reports. My work is mainly doing reporting now, I miss the analytical / business process improvement side of the work; as I see so many issues in the what we want in a report, compared to what the actual business problem is.

0
0
0.000
avatar
(Edited)

Yeah! I got pretty good at Power Query! I did a lot with turnaround times for things so I needed to duplicate and then split columns then change the timeframe from 12 hour times with AM/PM to military 24 hour time, adding in another step in the data transformation. You can only really do that (effectively) in Power Query with large datasets in Excel, I learned that pretty well! I'd be running it on sheets with 75k+ rows, some 200k+ so it was really fun. Bringing back some good memories for me! Lol. It's funny, now when I see someone at work that is presenting an Excel file if the background on the data is green I instantly know they likely used PQ to get it to display that way! Lol.

I hear you on the things we miss. I'm in a completely different role now where these things aren't really something I get to do, certainly not in the capacity I was doing it before and it makes me a little sad. I do consider trying to offer my consulting services to the group I used to work for hahaha they were always asking me to build them reports!

0
0
0.000
avatar

Our data sets are of similar sizes. There's a lot of joins done in the back end before they go to dataflows, and such.

It's been a good few weeks, no automated data refreshes have failed in that period. When I go back to work on Monday I hope it is the same story.

0
0
0.000
avatar

Python is such a fun language. I'm currently in the throes of learning some more NodeJS and I can safely say that, after using it for 5 years, I continue to hate javascript.

Hate it.

Despite it.

Loathe it.

A good part of my heart warms at another person learning python.

0
0
0.000
avatar

Yeah I've heard that JavaScript is a pain in the ass lol I think I started it for a few minutes, said fuck it and never went back. Python felt a lot more natural to me which is cool!

It’s good that you’re liking that dude! It’s always good to expand outside of what we are used to!

0
0
0.000
avatar

Thanks for your contribution to the STEMsocial community. Feel free to join us on discord to get to know the rest of us!

Please consider delegating to the @stemsocial account (85% of the curation rewards are returned).

You may also include @stemsocial as a beneficiary of the rewards of this post to get a stronger support. 
 

0
0
0.000