Wednesday 30 October 2019

Python - Day Fourteen (October)

WHAT I DID TODAY / LEARNED:


Today I did a 'challenge' rather than an actual lesson that teaches me things. I just did a review of things I learned and had to a challenge that's about making a grade book from a teacher's point of view. The 'grade book' calculates the averages, and prints out the results. Finishing this up leads me to the course being 50% complete now.

50% COMPLETE




  • I first had to write the given students names, and create variables named, name, homework, quizzes, and tests, and their marks.



FIRST STEP



  • After that I had to write codes that calculate each student's average percentage. Starting from line 21, that's when I wrote my code. I had to define how to get the average first, then make another define get average. You can look below for a better visualization of what I said.


STUDENT AVERAGE


  • The next step was to calculate the whole entire class average. This step was really easy as I had to just use if, elif, and return to 'define' what grade percentages there are. (as seen in line 32-42)  Then at line 53, which is the final step, I put everything together to calculate the entire class average. (results can be seen on right side of the image below.)

FULL COMPLETE GRADEBOOK


WHAT I WILL BE DOING TOMORROW / NEXT TIME:



Tomorrow I will be moving onto an actual new unit. It is called 'List & Functions' and there are a total of 18 lessons. I'm not sure how much of it I'll be able to go through, but I will probably split it in half as usual.

DESCRIPTION OF NEXT UNIT




Monday 28 October 2019

Python - Day Thirteen (October)

WHAT I DID TODAY:


Today I've completed the lesson/unit 'A Day at the Supermarket.' I mainly did exercises requiring 'loops' and 'lists and dictionaries.' Loops allow us to go through all the elements in a list, and use other codes/functions to further expand to different types of commands. I've now completed 45% of the overall course after finishing this lesson.


45% COMPLETED

And as always, I was told to do a review/exercise on what I learned.

'AT THE SUPERMARKET EXERCISE'


In this exercise I had to list the prices of fruit at the 'market' and how much of it is in stock. Then I had to use the new 'loop' code I learned to print out the whole list.

CALCULATING COST

I had to do another exercise, and this one was basically the last exercise and it required me to use codes to calculate the costs.


WHAT I LEARNED:


The main thing that was the focus of the lesson, was just loops. I learned that one new code, but learned a few different ways that code could be used and implemented together with other codes and functions.

I will quickly explain what a loop is again..

  • I learned that the loop code uses for and in. You might have noticed the use of it in the photos above already. This command just goes through a list.
LOOP EXERCISE

And you can choose how to use the code. In this short exercise, all I had to do was print out the list.


  • Another way I found out you could use loop for was to print only certain things you want from a list. For example, in an exercise that I will show below, I had to make sure the command only printed out 'even' numbers from a set of numbers.
PRINTING OUT ONLY CERTAIN THINGS


WHAT I WILL BE DOING TOMORROW / NEXT TIME:


Next time I will be continuing on with the course as usual. I will be moving onto the unit named 'Student Becomes Teacher.'

NEXT COURSE PREVIEW

There are 9 lessons in total, and I am planning to go through all of it.


Saturday 26 October 2019

Python - Day Twelve (October)

WHAT I DID TODAY:




Today I completed the 'Python Lists and Dictionaries' Unit. There were 14 lessons in total, and I was able to go through it all. Now I have finished 40% of the course.



40% COMPLETE

They also made me do a review as usual. It may look a bit foreign and confusing, but I will explain what's new and what I learned in the 'What I learned' section of my post.


THE FINAL REVIEW

I will give a brief explanation of what I was told to do in this review. I didn't write all of that, instead I just wrote the code starting from line 13 where it says # Your code here.

Basically I had to 'remove' and 'add' items that are in my inventory. That's what the review was mainly about.


WHAT I LEARNED:



I learned quite a few new things, that relates to lists and 'edit' them.


  • If you don't like the commas in a list, there's another way to make a list of items. And that is the .append() code. It's hard to explain but basically, below there's an example of suitcase and items. After doing suitcase.append(item) you could add any item in. Below is a visual representation. 


ANOTHER WAY TO ADD ITEMS/STUFF



  • Another code I learned for the 'lists' is the .remove() This one was pretty self explanatory, it just removes things from the list that you don't want anymore. In the photo below, you will see that the items that are removed does not appear on the list.
REMOVE CODE



WHAT I WILL BE DOING TOMORROW / NEXT TIME:


Next time I will moving onto the unit 'A Day at the Supermarket' There are 13 lessons total, and I will be aiming to complete it all.

PREVIEW OF NEXT UNIT

Monday 21 October 2019

Python - Day Eleven (October)

WHAT I DID TODAY / LEARNED:


Today I finished the 'Taking a Vacation' lesson. Except it wasn't really a lesson, I believe it's more of a review that wanted me to incorporate the skills I learned to calculate the costs of going on a 'vacation.' I did not learn anything new today and instead will just be explaining what I did.




35% OF THE COURSE COMPLETED


I will kind of be going through step by step of the review I did because I figured since I didn't learn anything today, I should be giving a more thorough explanation.




  • The first step I was told to do was to define the cost of hotels. I used the def function and return to calculate the cost of the hotel based on the number of days I'll be staying.

STEP 1: HOTEL COST



  • The second step was to calculate the plane cost ride using the def function, return, and elif. Based on the city I choose at the end, that will be how much the plane cost would be.
STEP 2: CHOOSING CITIES

  • The third step was to calculate car rental costs. I used the def function, if function, elif, and return. I also had to use different 'math' codes like == or >= because I was told to add 'discounts' based on the costs.
STEP 3: CAR RENTAL


  • The fourth step was just adding everything together. As you can see in the def trip_cost on line 22. I added all the other 'steps' together to get the total cost. After that on line 25, I printed out the actual trip cost. (I also chose the city Los Angeles, the cost changes based on what I choose)
STEP 4: FINAL STEP IS ADDING EVERYTHING TOGETHER


Basically this 'vacation' unit was just a review on the few codes such as return, elif, def etc; (if it wasn't already obvious.)




WHAT I WILL BE DOING TOMORROW / NEXT TIME:





Next time I will be doing the unit named 'Python Lists and Dictionaries.' I can't say much as I don't really know much about it either but here is a description of what it is about.


MY NEXT UNIT
There are 14 lessons in this specific unit, so I'm not sure if I will have enough time to be able to just go through half, or all of it.

Thursday 17 October 2019

Python - Day Ten (October)

WHAT I DID TODAY:


Today I fully completed the Functions unit. They taught me a bunch of new math related functions and code. So far I've finished 30% of the course. 

30% COMPLETED

They also made me do 3 different types of reviews.

BUILT IN FUNCTIONS REVIEW


FUNCTIONS REVIEW

MODULES REVIEW


WHAT I DID TODAY:


  • The first thing I learned was the max and min function. This function takes the max or min out of the number arrangements you choose. For example, if the numbers are (2,5,9) depending on the max or min function you choose, it will return the number that way. Here is a visual representation.

MAX EXAMPLE

MIN EXAMPLE

  • The second thing I learned was that you were able to see the whole list of math codes that can be used. This command is dir(math)
LIST OF MATH CODES

You can also use a universal import code to be able to use all the math-related codes instead of having to constantly re type the code in.

UNIVERSAL IMPORT CODE


WHAT I WILL BE DOING TOMORROW / NEXT TIME:


Next time I will be moving onto another unit. Except the next one isn't an actual unit I'm pretty sure but another practice exercise.

PREVIEW OF NEXT 'UNIT'

There is only 7 lessons, but I will probably have to take my time on this one and think more.


Tuesday 15 October 2019

Python - Day Nine (October)

WHAT I DID TODAY:


Today I started on the Functions unit and completed 9/19 lessons. This unit just further explained what I knew about functions so far, and made me do more exercises and practices based on my knowledge so far. It was only 9 out of 19 lessons so I only learned one or two things. 

COMPLETED LESSONS



I also did an exercise on what I've learned in the past related to functions. In the exercise, it has basically everything I've explained already in my past blogs, but just put together.

EXERCISE ON FUNCTIONS (OR REVIEW)



WHAT I LEARNED:


  • The first thing I learned was very quite simple. It was just how to square root a number. In my past posts I've learned and talked about the simple things like adding, subtracting etc, but never about how to square root. 

HOW TO SQUARE ROOT NUMBERS

All you need to do is write import math at the top, then from there write print math.sqrt() You would think they would have already taught this but I just learned it today.


  • The second thing I learned, but haven't quite got a hang of it yet (don't understand it a lot because haven't done much exercises on it) is that functions are able to call other functions.

FUNCTION CALLING ANOTHER FUNCTION EXERCISE

I can't quite expand on this yet considering I didn't get to do it much, but probably in my next post I will learn more about it so I decided to talk about it in this post because it is a new 'fact' that I learned despite not knowing how to make use of it yet.


WHAT I WILL BE DOING TOMORROW / NEXT TIME:


Next time I will aim to complete the 'Functions' unit, which has 10 lessons left.

REMAINING LESSONS

Thursday 10 October 2019

Python - Day Eight (October)

WHAT I DID TODAY:


Today I have completed all 11 lessons on the unit 'PygLatin' that I intended to do. Now I have completed 25% of the 'Python 2' course.


25% COMPLETE

After completing this though, it felt more like a small project and not an actual unit. I did learn things, but it wasn't a lot because it mainly consisted of things I've learned throughout the past.


THE FINISHED TRANSLATOR

This may look a bit confusing, but basically the point of this translator is that you type a word in, and returns back as a 'PygLatin translated version.' If I just enter a whole alphabetical string, it will just return back as all lower case letters and the first letter of the word printed will go the back and 'ay' will be added to the end. I actually don't really understand how and why this would be needed yet but maybe I will find out in the near future.



WHAT I LEARNED:


I did not learn many things, rather I just integrated the things I've learned before. So it's just a few new things I've learned..

  • The first thing I learned was a code or function. And that is raw_input() It's the most important thing I learned this unit because it's like the base/foundation of this translator. This code basically accepts a string, prints it, and then waits for the user to type something and press Enter (or Return) I think it'll be hard to understand just by reading and not actually doing it, but here's an example.

VISUAL EXAMPLE OF WHAT I SAID

(The last line #6 is just basically an extra one and not mandatory, it just asks the same question without erasing the first answer)


  • The second thing I learned was the .isalpha() code. This code is helpful because it can be used with many other codes such as if and and statements. This code checks to see if a string contains letters. This can be used many ways , but the way I was told to use it was if there's non-letter characters in the string, the word will not print.

THE REPLY WAS 'empty' BECAUSE MY 'WORD' CONTAINED NUMBERS


WHAT I WILL BE DOING TOMORROW / NEXT TIME:


Next time as usual, I'm planning to continue on with the Python 2 course. I am doing the unit 'Functions' next.

DESCRIPTION OF WHAT THE UNIT IS ABOUT

There are a total of 19 lessons in this unit. I will definitely not be able to go through them all, so I think I just do what I usually do and go through half or a bit more then do the rest the other time.

Tuesday 8 October 2019

Python - Day Seven (October)

WHAT I DID TODAY:


Today I finished up the remaining 7 lessons I had left on 'Conditionals & Control Flow' Unit. Now I have completed 20% of the overall 'Python 2' course.

20% COMPLETED


As usual, after a unit ends, there is always a review. This time the review was a bit more interesting than the others. They made me calculate the grade aka A, or B etc;


MY REVIEW OF EVERYTHING I LEARNED IN THIS UNIT




WHAT I LEARNED:


I learned mainly about statements. To be more specific, I learned about 'elif', 'else,' statements. They work well with booleans, aka True/False codes and 'if.' 

  • The first one I learned was the 'else' statement. Basically it means 'or else.' For example, you would be writing a statement that says if 5 > 6 , print 'Correct' Here is where the statement 'else' comes in. If it's wrong you can write else print 'Wrong' My format on the explanation isn't correct but I was just giving you the idea of what I mean. Here's a picture showing exactly what I mean.
EXAMPLE OF HOW TO USE 'ELSE'


  • The second one I learned was 'elif.' Elif is short for 'else if' meaning, "otherwise if the following expression is true, do this!"
EXAMPLE OF 'ELIF'

('elif' only gets read if the first statement is false.)



WHAT I WILL BE DOING TOMORROW / NEXT TIME:


Next time I will be moving onto the next unit 'PygLatin' 

DESCRIPTION OF THE 'UNIT'


The description makes this look more of a 'project' than a unit itself, but I'm sure they will still teach me a few things or two.

There are a total of 11 lessons in this 'unit.' I will aim to complete all of that in my next post.


Friday 4 October 2019

Python - Day Six (October)

WHAT I DID TODAY:


Today like I expected from last day, I finished half of the 'Conditionals & Control Flow' Unit in a day. I couldn't get farther because I was trying to understand how the code works, and it is starting to become a bit more challenging.


THE 8/16 LESSONS I'VE COMPLETED

This unit is said to help me learn how to generate different outcome based on the user's input.


WHAT I LEARNED:


Most of the code I learned was understandable, it's just I believe that I need to learn the theory behind these codes to truly understand what I'm typing into the program. Despite that, I did learn a few new things.

  • The first thing I learned about is comparators. There are six different types... There is 
'equal to' (==
'not equal to' (!=)
'less than' (<)
'less than or equal to' (<=)
'greater than'  (>)
'greater than or equal to'  (>=)

Some of these are probably already familiar but some could be new. Like for me, equal to, not equal to was the two new things I learned. The other signs were already known for me. And these comparators are usually used to check if values are greater/lesser or equal to one another. (And I'm pretty sure they can be used together with booleans aka true/false commands)

NOT EQUAL TO

EQUAL TO

  • The second thing I learned was 'and, or, not' expressions. This one was a bit iffy for me because I didn't finish the whole Unit nor did I do many exercises on these yet, but they were something new that I learned so I'm adding it in.
The boolean operator and returns True when the expressions on both sides of and  are true.. for example -
  • 1 < 2 and 2 < 3 is True
  • 1 < 2 and 2 > 3 is False

THE EXERCISE MADE ME JUST WRITE and, true, and false


The boolean operator or returns True when at least one expression is TrueBasically it's exactly what I explained above.

THE EXERCISE ONLY MADE ME WRITE or, true, and false

The boolean operator not returns True for false statements and False for True statements.

ONCE AGAIN, ALL I HAD TO DO WAS WRITE THE BLUE TEXT

WHAT I WILL BE DOING TOMORROW / NEXT TIME:



Tomorrow I plan to finish up the unit 'Conditionals & Control Flow.' I have 7 lessons remaining.

THE REMAINING LESSONS

I know for sure I will not be able to start a new unit despite having only 7 lessons left, as these are becoming a bit more challenging and require a bit more time to understand.

Adobe Photoshop - Day 10 (June Final Post)

WHAT I DID TODAY / WHAT I LEARNED: For my final project, I thought for a while about what I could do. Then I remembered a while back I saw ...