Return to Level1Techs.com

A CS Student's Blog

Hey L1 crew!

I’ve just started my first real computer science class (I’m at a relatively small California community college, working on an Associates of Science for Transfer to a university down the road) and it’s got me super excited about the field.

I feel lucky to have an instructor who really knows his stuff, and is cultivating good coding habits early on given the format of the assignments and how the class is ordered. The labs we do are very specific in the instructions and he’s sure to grade our assignments accordingly. (The idea is that we’re writing code to a certain spec and if it’s not up to spec then it fails, which I gather is how it works on the job)

I’m learning way more than I did in the intro class. We used javascript, which I enjoyed! But the content wasn’t very challenging and didn’t do much beyond informing us of the basics (what’s a variable, how do functions work, order of execution etc, valuable stuff but we didn’t do much with it) so I didn’t find it too engaging, though I do find it incredibly useful now that I get to actually apply it to marginally more complicated assignments.

We’re using Python 3 and the text is Think Python 2nd Ed, by Allen B. Downey

Anyway yeah! Just wanted to share I’m really enjoying this stuff and can’t wait to learn more. As my assignments grow in complexity I think I’ll post them to my github (once they’re graded, and I learn how to use github) and link it here, because I’d love to get feedback (of any kind) from people with experience in the field. My goal is to become a Software Engineer. Feel free to ask any questions as well, and thanks for reading!

5 Likes

Jupyter Notebook is a pretty nice for getting quick outputs.

Doesn’t have as much debugging capability as a IDE, but is fairly nice if you want a quick output from code you make. Also nice if you want to get into Data Science.


I also wrote a guide for installing it on Fedora also works for linux.

Also Visual Studio Code looks like a good alternative if you don’t want to deal with the notebook format

My machine learning class uses Google Colab, which is Google’s own version of Jupyter Notebook (?) It’s pretty neat, and let’s you tap into Google’s gpu servers😏

3 Likes

Looks like a good way to save on having to install new IDEs or vim addons every time I want to check out something but what exactly is it? The websites mumbo jumbo doesn’t really explain anything and it goes from Jupyter to “notebooks” and “binder”

1 Like

Thanks for the tip! We’re using PyCharm for the class so I’m covered as far as IDEs go for now, but this looks interesting! I’ll definitely check it out at some point.

1 Like

So I just finished a lab (8th one so far) that had us do the following:

With the caveat that: Python string methods and library functions
that work with strings are off-limits for this lab

And I’m super proud of what I came up with. Screenshot here:

Code here, feel free to copy paste and see what the output is (you will need to put the indents in the right place again sorry, the formatting was weird on the copy pasta, I’ll look into it for the next post):

def charCount( c , word ):
count = 0
for character in word:
    if c == character:
        count += 1
print("'", c , "'" , "appears in" , "'", word , "'" , count , "times.\n")

def removeChar( c , word ):
newWord = ""
for character in word:
    if c != character:
        newWord = newWord + character
print("'", word , "'" , "without" , "'", c , "'" , "is:" , newWord, "\n")

def stringSlices( word ):
index1 = 0
index2 = 1
print("All possible slices of:" , "'", word , "'" , "\n")

   def charTotal( word ):
    count = 0
    for character in word:
        count += 1
    return count

for i in range(charTotal( word ) ):

    while index2 <= charTotal(word):
        print(index1, index2, word[index1:index2])
        index2 += 1

        if index2 == charTotal(word) + 1:
            index1 += 1
            index2 = index1 + 1

I have a tendency when I start coding, to jump from thing to thing, trying to do everything at once, instead of focusing down on one requirement at a time, and that ends up hurting my progress.

I’m getting better though. I also am getting past the initial ‘No idea how to do any of that’ phase and just thinking step-by-step how to solve problems. Especially after this assignment. (my initial thought was to throw everything in a list and then concatenate from there lol)

So the thing on this one I’m most proud of was my function within a function on stringSlices, the requirement to avoid using methods/library functions for this lab had me stumped for a good while, but I really got the (I’m gonna call it the Programmer’s High) when I came up with that one.

As far as what I need to improve, I think I need to keep working on my initial approach to these problems, my reflex is to keep the scope too wide and that slows me down at the beginning. I also face a bit of decision paralysis at the start, but I’m getting more comfortable with not knowing how to solve something immediately, and just generally taking it slower when looking at these problems. One step at a time (build the track as the train picks up speed on it) seems to be the way to go forward for me.

That’s all for now! Feel free to post your questions and comments if you have any, hope you found it entertaining/interesting and thanks for reading.

3 Likes

Why not make a github?

1 Like

This is the plan I just didn’t think of it in my excitement at 2 am lol I’ll figure out how to do that today and then post it :slight_smile:

1 Like