Blog 1: Intro to Python

Welcome to my first blog!

Today, my fellow Fusion classmates and I took it upon ourselves to create a project related to the coding language of Python.

I personally have some experience with C++ myself so I decided to just skim through some of the basics and make my own project at a more accelerated pace. I created a flow chart here for all you non-enthusiasts for easier comprehension of how my project works.

Just a quick rundown here, but my project is pretty much just a simple guessing game between 1 and 100. You play 3 rounds each, getting points based on how many tries you take to guess the number. The number is randomly generated, so cheaters, don’t even try.

This flowchart has different colours and shapes, but it’s mainly the shapes that matter the most. Ovals represent start and end points, diamonds represent decisions, rectangles represent actions/functions, parallelograms represent the input/output for data and the squiggly rectangles are for the inputs/outputs for documents.

The code starts with importing a random module to make the random function possible, and setting basic parameters such as game length and generating the number. It then transitions into more of the output aspect, printing out questions and processing answers until the user finally gives the correct answer. Points are distributed based on how many attempts you take, from 1 try getting 10 points to 10 tries giving you 1 point, and anything past that giving you none. The biggest problem for me was probably learning how to use the underscore and periods, along with holding back from putting semicolons at the end of each line for syntax. Other than that, I didn’t struggle too much on this because of my prior experience in other coding languages. Overall, I think it’s pretty concise and if I had less time constraints, I could probably make some code that isn’t a measly 40 lines long. On the bright side, that may be a good thing because of my conciseness.

Here is a link to my project for you to run it through this IDE.


Comments

One response to “Blog 1: Intro to Python”

  1. mcrompton Avatar
    mcrompton

    Good job, Matthew. Nice piece of code, well thought out and addresses all of the requirements of the assignment!

Leave a Reply

Your email address will not be published. Required fields are marked *