Week Three – Day # 2

alarm
Replace 6:00am with 5:30am

Today was an EARLY one. I was the first one there again. I think I’m starting to like the calm right before everyone arrives. It’s pretty similar to when I was teaching. Loved getting to school an hour before sectionals to work done. I am hoping to adopt the same habits with coding!

Before it was time for algorithms, I was able to complete half of the Python Fundamentals in the learning platform. Our algorithm this morning was interesting. The goal was, given an array and a min and max value, find all values between min and max and move them to the front of the array while removing the values outside of the min and max. Seems simple enough! A good .pop or ought to take care of those values we want to remove. EXCEPT, we weren’t allowed to use an built in array methods…

crap
My exact reaction…

Without giving away the answer, my partner and I spent about 35 minutes working through it. The aspect I love most about solving algorithms is it’s good practice at problem solving. In fact, I approach algorithms very similar to how I approach teaching.

  1. Break down what the problem is asking. Don’t try to do too much all at once. Break it down to smaller parts.
  2. Create a road map to the solution; also known as visualizing. Don’t work out any details in this step. It is meant to be very general and broad but it helps to set you in the right direction.
  3. Time to code. If you have no idea where to begin, start with what you know. Just get SOMETHING down on paper…er…computer. (Actually, when working through algorithms, we aren’t allowed to use computers. We are discouraged from googling and testing code in the console. Instead, we do all of our work on the whiteboard with a dry erase marker.)
  4. If you get stuck (more like WHEN you get stuck) don’t give up or get frustrated. Make a comment and move on. Leave it and come back. This was the hardest step for me to follow. I am very accustomed to making sure all of the pieces are in place before moving on to the next thing. Unfortunately, when coding, I wouldn’t get very far if I did that all of the time.
  5. Once you have written all of the code, it is time to test your algorithm and find any breaks or crashes in the code. If you find a break, start at step 1 and break it down.

You could take the steps I have listed above and literally apply them to ANY situation or problem you might encounter in life.

I LOVE this about coding. It forces you to be a problem solver.

solved

After algorithms, we had another short lecture this morning. Before the lecture, however, our instructor gives us an opportunity to ask any questions about homework assignments from the previous day. I always feel like I’m hogging all of the questions during this time…but I feel like if our instructor gives you an opportunity to pick his brain, you should take it! We continued with the lecture and we were introduced to Python functions and dictionaries. Functions in any coding language is a group of code then can accept parameters but it isn’t required. Functions also provide a means of reusing code without having to rewrite or copy code. Helps to keep your code “DRY”. Dictionaries are used to store information based off key-value pairs. When you wish to get some info, just call on it’s key to obtain the value.

The rest of the day was spent working on assignments until about 2:30pm. After that, we had a short group activity over dictionaries. When working in a group, we utilize “popcorn coding”. It involves only one computer and we all write a few lines of code and then switch out to the next person. This method of coding ensures that everyone has something to contribute to the final product. It also provides opportunities to learn from your peers if someone gets stuck or codes something incorrectly. I think it’s a great tool.

After the group activity I spent the last part of the afternoon finishing up my assignments for the day. Planning on staying ahead and reading the next module over Object Oriented Programming with Python!

Wow. This was kind of a long post and it probably wasn’t very interesting to read. I am still trying to figure out a balance between just throwing all my thoughts/experience in here versus creating an entertaining read for anyone subscribed. Let me know if you have any suggestions! I would love to hear from y’all!

Off to do more studying!

study

 

 

Start of Week 3: Python Stack

Today was HUGE. We started our first full stack, Python. Just some quick info about Python:

  • It’s an interpreted language, which means it doesn’t need to be compiled
  • Python is frequently used in data science and machine learning
  • Python is simpler to read and write in terms of syntax. It doesn’t require curly braces like JavaScript and instead uses indentation to create different block groups.
  • Python functions very similar to JavaScript.
  • There are A LOT of built in method and functions to use with Python

Before starting with Python, we received our scores for the second Web Fundamentals belt exam. I surprisingly did better than I thought. 9.9 out of 10. Still aiming for that elusiveĀ  10 out of 10…

nerd

After getting our exam scores, it was time for the daily morning algorithm. This one involved a given array and value, with which we needed to move the value to the first index of the array. Simple enough? The catch was we were NOT allowed to use any built in methods like .push() or .shift() and .unshift(). This made things a little more tricky. I developed a solution but couldn’t figure out how to write the code for it. After about an hour, we presented different group solutions. After seeing the first solution, I realized that I still struggle with overthinking the problem and finding the most complex way to solve these algorithms. The first group simply created a new array and immediately added the given value as the first index. From there it was as simple as just iterating over the given array and moving those values over to the new array. Simple, right?! Haha.

facepalm

Moving on to Python, We started the morning with a real quick lecture. We went over the differences between Python and JavaScript and then talked about some Python specific attributes. After the morning discussion it was time to download Python. I was a little surprised we were going to be working with Python 2.X instead of Python 3.X but it was explained in a way that actually made sense. Long story short, Python 3 isn’t backwards compatible with Python 2 andĀ  a lot of businesses and web developers still utilize Python 2. If one did need to move from 2 to 3, it would be an easier transition than working backwards.

I had some memory issues with my GitBash. It would keep giving an IO Error anytime I ran a large loop. I asked one of the instructors for help and he couldn’t quite figure it out either. I decided to use both the Command Prompt and Windows PowerShell. Fortunately, PowerShell uses the same command-line interface commands as a Mac or Linux system.

computer

The next few hours were spent working on assignments that involved variables and conditionals to get us used to working with the Python syntax. I left the Dojo a little later than usual today. I spent a good 12 hours there today! My goal is to increase my weekly hour total to 70-75+ hours per week. I’m averaging 60-65 hours right now…

Tomorrow is more Python functions, dictionaries, and tuples!