Computer Programming:
Project Outline:
Our entire STEM class took an online course on Python computer programming. The minimum thirteen-hour course was taken off of Code Academy. Although there are many other computer programming languages out there, we chose to do Python because the robots we would later create in the unit could only read Python.
Our entire STEM class took an online course on Python computer programming. The minimum thirteen-hour course was taken off of Code Academy. Although there are many other computer programming languages out there, we chose to do Python because the robots we would later create in the unit could only read Python.
Code Academy link: < codeacademy.com >
Terms:
Variable - stores piece of data and gives it a specific name (ex: python = 5 "the variable 'python' now stores the number 5")
Boolean - a data type that can only have two values (ex: a = True, b = False)
White Space - used to structure code and properly indent with four spaces
Comments - messages in the code that are not read by the computer, only for humans to see, encased by quotations ("This is a comment"). A comment that stretches over more than one line needs three quotations on either side. ( " " " Insert comment here. " " " )
Functions - one of the most basic methods in code, entered into the code by defining it (ex: def new_function: )
Editor - the area where you write your code
Console - where the code results and/or error messages are shown
Exponents - the exponent sign (^) is not used, instead (**) is
Division - %
Modulo - returns the remainder from a division (ex: 3 % 2 will return 1)
Strings - another useful data type that con contain letters, numbers, and symbols (ex: brian = "Hello life!")
Apostrophes - these break the strings, so in Python code, we use a backslash to fix this (ex: There\'s a snake in my boot. )
Variable - stores piece of data and gives it a specific name (ex: python = 5 "the variable 'python' now stores the number 5")
Boolean - a data type that can only have two values (ex: a = True, b = False)
White Space - used to structure code and properly indent with four spaces
Comments - messages in the code that are not read by the computer, only for humans to see, encased by quotations ("This is a comment"). A comment that stretches over more than one line needs three quotations on either side. ( " " " Insert comment here. " " " )
Functions - one of the most basic methods in code, entered into the code by defining it (ex: def new_function: )
Editor - the area where you write your code
Console - where the code results and/or error messages are shown
Exponents - the exponent sign (^) is not used, instead (**) is
Division - %
Modulo - returns the remainder from a division (ex: 3 % 2 will return 1)
Strings - another useful data type that con contain letters, numbers, and symbols (ex: brian = "Hello life!")
Apostrophes - these break the strings, so in Python code, we use a backslash to fix this (ex: There\'s a snake in my boot. )
String methods:
1 len () = length / number of characters of a string 2. lower () = gets rid of all capitalization 3. upper () = capitalizes all letters 4. str () = changes non-strings into strings |
Examples of string methods:
1. given parrot = "Norwegian Blue", len (parrot) = 14 2. "Norwegian Blue".lower () = "norwegian blue" 3. "norwegian blue".upper () = "NORWEGIAN BLUE" 4. str (2) = "2" |
Reflection:
I learned a lot through doing computer programming. It was my first experience doing any type of computer language, so it was difficult for me to grasp at times. Coding isn't one of my strong points, and I will admit that the course was challenging and frustrating at the same time, especially because the online course didn't exactly present a teacher to go over the confusing parts. However, it was a testament to our class's perseverance because everyone worked hard to finish the course. It took longer than expected for most of us because we would be stuck on some lessons for days at a time until someone figured it out.
Perhaps most importantly, this unit on computer programming taught me how important the little details are. In Python, one missed colon, indent, or semicolon could ruin the entire thing. It was definitely a continuous struggle from the first lesson to the last, but it was extremely satisfying each time I coded something correctly and when I finally finished the course.
All in all, doing Python programming taught me a lot of great life lessons and I learned a lot.
I learned a lot through doing computer programming. It was my first experience doing any type of computer language, so it was difficult for me to grasp at times. Coding isn't one of my strong points, and I will admit that the course was challenging and frustrating at the same time, especially because the online course didn't exactly present a teacher to go over the confusing parts. However, it was a testament to our class's perseverance because everyone worked hard to finish the course. It took longer than expected for most of us because we would be stuck on some lessons for days at a time until someone figured it out.
Perhaps most importantly, this unit on computer programming taught me how important the little details are. In Python, one missed colon, indent, or semicolon could ruin the entire thing. It was definitely a continuous struggle from the first lesson to the last, but it was extremely satisfying each time I coded something correctly and when I finally finished the course.
All in all, doing Python programming taught me a lot of great life lessons and I learned a lot.