2 minute read

Today in class we discussed Python and Codespaces. First we discussed setting up a Jekyll template for our eportfolios. We added a webrick line to the gem file, then we used bundle followed by jekyll serve to launch our preview website to edit freely. Jekyll runs off ruby code. We downloaded suggested packs from the codespace such as python extensions. This will be quite useful for developing our own websites.

We discussed plans for the next few weeks. Fortunately for me, we are going to learn some python and base coding that will be useful for an AI lecture later in the semester. I am excited for that as I am interested in ai development and the gateway to get into that industry.

Next we created a codespace for coding with. We note that an empty repository will load a codespace much more quickly than a forked repository. We test some basic math equations and see that the codespace is working. Next we look into REPL, read eval. print loop.

We discuss two ways to create a loop in python. One way is for num and prints out 100 responses. The second way is to use _ underscore instead of num, with _ underscore being a variable. This gives the loop the ability to not count 0 to get a more accurate print out.

We then talk about a REPL displaying how to calculate the sum of all numbers in a range of 1 to 101.

Dr. C whipped out some sagemath and linear algebra on us to show if the answer in the codespace was correct, which it was, and to show us a quicker way to number crunch instead of coding it out in the codespace. After flexxing sagemaths capabilities for a few minutes we got into the good stuff.

We create a main.py python file. We discussed the benefits of a text editor with color coding. We do some simple hello world and similar prints and then talk about terminating processes. We want to execute the code

The class moved onto Fizzbuzz. It is a game where the group counts numbers starting at 1. When the number is a multiple of 3 the player is supposed to say fizz instead of the number. The players are supposed to say buzz when the number is a multiple of 5. Players also say fizzbuzz when the number meets both criteria. The game gets more hectic as the number count gets higher.

We move onto group programming the game of fizzbuzz ourselves. Dr. C set us up with a basic script to count to a variable game length that we can change later. We set the variable to 100 for now.

We wrote a few comments with rules, source, and expected outputs through 30. We then proceeded to write a loop involving the variable game length that we set earlier. Lastly we talked about if , else loops. We stopped coding here and discussed other class matters and then prepared to leave.

I am looking forward to learning more python and coding skills in the future as I am certain it will increase my opportunities for employment.