Thursday 28 November 2019

Python - Day Twenty Four (November)

WHAT I DID TODAY:


Today I started on the unit,'Advanced Topics in Python.' So far all I worked on was a little bits of different things, such as lists + dictionaries, list slicing, and working with numbers again. This unit wasn't as specifically based on a single topic as other units.


There were a total of 18 lessons in this unit, and as I didn't have time I just completed half of it, leaving the other 9 lessons for the next class or when I do it again.


These were the 9 lesson topics I covered..


FINISHED LESSONS


I also did a few exercises..



  • One of the few exercises I did today was that I had to create a list that is called even_squares. This is kind of self-explanatory but I was told to make the code only print out even squares in this exercise.

EXERCISE #1 - PRINTING EVEN NUMBERS

And another similar one to the one above is that I had to do the same thing except with 4 cubes.

EXERCISE #2 - CUBES BY FOUR




WHAT I LEARNED:


It's been a while since I actually learned some new codes/commands. But this lesson actually taught a new code.


  • They taught me the .keys() and .values() code. I'm putting them in the same 'category' or 'paragraph' because code academy only required me to use these codes once. There wasn't a single specific lesson to use each code. These technically only showed up once in the exercise below so I had to include them together.

.keys() and .values() code



WHAT I WILL BE DOING TOMORROW / NEXT TIME:



Next time I will complete the remaining 9 lessons within this unit.

REMAINING LESSONS FOR NEXT TIME


Tuesday 26 November 2019

Python - Day Twenty Three (November)

WHAT I DID TODAY / LEARNED:


Today I started on a new unit. It wasn't really a new unit and more of a review unit/exercise. In this 'unit' I had to do a similar exercise that I did in the past. Today this exercise was based on grades and calculating it etc; 

It's different from an exercise I did in the past though because this exercise had more to do with doing different things with the marks, rather than calculating averages or something else. These were the 9 lessons I finished.


FINISHED


I also didn't learn anything new today again because now that I'm nearing the end of the course, I'm pretty sure they taught me the basics already and now I have to apply my skills. I'm not saying I definitely won't learn anything new in the future, but I'm saying the chances of me learning completely new things are lower than in the beginning.

Now I have completed 75% of the Python 2 course.

75% COMPLETE



  • The very first lesson required me to just print out the grades. (The first step) The 'grades' were already listed out for me so I had to just code.

STEP #1


  • The second step was to use a code to find the sum of all the numbers together. This is what I meant from it's different from the last 'grade book' project I worked on. I had to kind of do random things relating to this instead of actually working on the idea of the grades itself.

STEP #2


  • The third step was something I did before, and it actually relates to the unit, is calculating the average of all the grades.

STEP #3


  • The fourth step kind of confused me so I needed a bit of help in figuring it out because I didn't really understand what was being told of me to do. I was told to 'code' so the computer prints out the grade's variance.

STEP #4


  • The final step was to just print out all the work I did. And so everything appears on the right side. This includes the grades, sum, average, and variance + deviation.

FINAL STEP




WHAT I WILL BE DOING TOMORROW / NEXT TIME:


Next time I will move onto the next unit as planned. The next unit is named, 'Advanced Topics in Python.' I feel like I might learn new things in this unit actually but I'm not quite sure so we'll see.

Here's a preview/description of the next unit.

NEXT UNIT DESCRIPTION

Friday 22 November 2019

Python - Day Twenty Two (November)

WHAT I DID TODAY / LEARNED:


Today I completed the remaining lessons on the 'Practice Makes Perfect.' This actually took me longer than a class to complete though because the lessons were more complex and I had to do each exercise from scratch. But I didn't want to span this one unit to 3 days. 


And since this is still the same unit as last day, and it's in the title, I didn't learn anything new in this unit as it was literally all review.

Now I have completed 70% of the overall Python course.


70% COMPLETE



I will just talk about and show the different types of exercises I was told to code.


  • The first exercise, I as was told to type a 'program' where the user types in a word, and the code will remove all the vowels. It sounds like it wouldn't be especially useful in this situation, but I can imagine other ways this exercise was useful. And also this was just random exercises to practice skills, so most of these are pretty random and have no purpose.

REMOVING VOWELS FROM WORDS EXERCISE #1


  • The second exercise was about censorship. The code will use **** as a censorship for words that the user chooses to be censored.
CENSORSHIP EXERCISE #2

HOW THIS WORKS IS MAINLY ON LINE 14. AFTER THE COMMA, THE WORD THAT IS THERE WILL BE CENSORED. FOR EXAMPLE, IN THE IMAGE ABOVE, THE WORD 'HACK' IS CENSORED BECAUSE IT WAS CHOSEN.



  • The third/fourth exercise is kind of related to numbers in a way, so I will put it together. The third one counts how many 'same' numbers there are. And the fourth exercise takes out odd numbers. I'm not sure if that was understandable or not, so I will provide an image below for a clearer visualization.

COUNT EXERCISE #3

ODD NUMBERS EXERCISE #4


  • The last exercise I did was code that removed duplicates. For example, if there was a duplicate number in the same code, it will exempt the number in the final output results.

DUPLICATE EXERCISE  #5



WHAT I WILL BE DOING TOMORROW / NEXT TIME:



Next time I will be continuing on with the Python course as usual. The title of the next unit/lesson is 'Exam Statistics.' Here's a preview/description of it.

NEXT UNIT


This kind of looks like another review unit, so I'm unsure if I will learn new things. But I think now that I'm nearly coming to an end of this course, I won't learn new thing at all or maybe just a tiny bit. 

Wednesday 20 November 2019

Python - Day Twenty One (November)

WHAT I DID TODAY / LEARNED:


This unit that I currently worked on today named, "Practice Makes Perfect," was literally what the title says it is. I'm pretty sure I don't learn anything new this unit, instead I just do practice problems, or exercises that they tell me to do. It was pretty random exercises involving numbers that change all the time. 


I didn't get through all the exercises, there were 15. I thought I would get through all of it but the exercises took a bit of time to figure out so I only got through half aka 7.

Since this was a review unit, and I didn't learn new things, I'll just once again explain the few exercises I was instructed to do today.




  • The first exercise I worked on was returning the number the user gives, into a factorial form. So for example, if the user inputs the number 4, the factorial of the number 4 will return as 24.

EXERCISE #1



  • The second exercise I was told to do was kind of like 'identifying prime numbers.' So if the number was a negative (not prime number) the code would return as 'false.' But if the number is PRIME then the code would return as 'true.'

EXERCISE #2




  • In the final exercise of the day, I had to allow codes to take a certain word, and print/return it into a reverse form. For example, the world 'hello' would be turned into 'olleh.'

EXERCISE #4


THE LAST EXERCISE WAS A BIT HARDER THAN I THOUGHT, SO I HAD TROUBLE WITH IT FOR A WHILE. I ENDED UP USING MOST OF MY TIME ON THIS ONE EXERCISE. IN THE END THOUGH I HAD TO USE HINTS TO ACTUALLY FIND THE SOLUTION.



WHAT I WILL BE DOING TOMORROW / NEXT TIME:


I will aim to finish the remaining 8 lessons on this unit because I don't want to drag on a unit for more than 2 days unless it has many lessons. In this case there only 15 lessons, so I will try to finish it.


REMAINING LESSONS

Friday 15 November 2019

Python - Day Twenty (November)

WHAT I DID TODAY / LEARNED:

As you can above by my title, if it wasn't already obvious, I didn't learn anything new today because I think they already taught me all the new things/codes in the beginning. I would assume it's like that because all I did were small exercises using the new codes. I now have finished 65% of the Python course.


65% COMPLETED


I did a few different exercises that showed me different ways to use the new codes. A quick recap of the new codes I learned were while and else. (and just how loops work in general.)

  • The first exercise I did incorporated the use of range, letting the user type (raw_input), and append. In this exercise I had to add code that asked the user what their hobbies were. And the question repeated 3 times, then printed them after I answered 3 times. (range number on line 5)

EXERCISE #1 USING RANGE


  • The second exercise I did was string manipulation. Basically to make it simpler, I was told to 'substitute' a certain character I didn't want for a different one. If that was confusing, look at the image provided below for a clearer visualization.

MANIPULATION EXERCISE

As you can see from the photo, the code states that every letter A should be replaced with the letter X. The result is on the right.


  • The third exercise was simple, as all I had to do was make one character span to one line each. It's kind of hard for me to explain how this one works, but I just used for and in, to print the words out.

PRINTING OUT EACH INDIVIDUAL CHARACTER


Finally, as always, there was a final review type of exercise to end off on. This one didn't require tons of coding, but it wasn't also super easy.


FINAL REVIEW

I had to use everything I learned in this unit. AKA the use of loops, and else. Also I had to use a few old codes I already knew. Like using variables obviously, and for and in.



WHAT I WILL BE DOING TOMORROW / NEXT TIME:


Next time I will move onto a new lesson/unit called 'Practice Makes Perfect.' Since 'Loops' was actually a new unit, I would say that the new thing I have to work on is probably a review-type lesson to practice. (meaning I can't guarantee if I'll learn anything new that day.)

PREVIEW OF WHAT I'M DOING NEXT


Even the description of the next lesson is self-explanatory. It looks like I will be mainly practicing next time!

Thursday 14 November 2019

Python - Day Nineteen (November)

WHAT I DID TODAY:

Today I started on the 'Loops' unit. There were 19 lessons, so as usual, I divided it in half. I finished 9/19 lessons in this unit.


THE 9 LESSON TOPICS I COVERED


Since I only did half of it, I didn't do a review yet, but rather I did a small exercise that kind of shows everything I learned/did today.

THE EXERCISE INCORPORATING THINGS I'VE LEARNED TODAY


This may or may not look foreign, but in this exercise, I was told to write a small thing where the user has 3 guesses to guess a random number that the computer generated. If the user guesses correctly, then it prints,"You win!" but if the user guesses incorrectly, it will print,"You lose."




WHAT I LEARNED:


There are a few new things I learned today. Including what a 'loop' is or does when using Python programming. Loops execute codes repeatedly until a given condition is satisfied. 


  • The first thing I learned was condition of a loop. Basically the condition is the expression that decides whether the loop is going to be executed or not. If the loop condition for example is set to true, then only then will the loop proceed. But if it's 'false' then the loop will not execute. For a better understanding, look at the image provided below.

IT ONLY PRINTED ONCE BECAUSE THE LOOP CONDITION IS FALSE

(If the loop condition were to have been set to true, the right side would have just continuously printed, "I am a loop" with no end.)



  • The second thing I learned was the while code. When talking about loops, the while code always has to be mentioned with it because it plays a very important part in loops. It is similar to the if statement and it executes the code inside of it if the condition is true.

EXAMPLE OF THE USE OF WHILE


  • The third thing I learned was the else code. It may not be completely new but I learned it as a 'another way to use it' kind of thing. This code works with the while code and it executes anytime and every time a condition is false.

THE USE OF ELSE


(This was just a random exercise that chooses 3 random numbers, and if the number isn't 5, then the else code prints "You win!"



WHAT I WILL BE DOING TOMORROW / NEXT TIME:


Tomorrow I will continue on with the remaining lessons in the 'Loop' unit. There are 10 total lessons left. 

REMAINING LESSONS


Wednesday 13 November 2019

Python - Day Eighteen (November)

WHAT I DID TODAY:


Today I completed the 'Battleships' exercise-type lesson. I had 9 lessons left out of 19, and today I just added things like errors, and what the game would do if the person guesses wrong or misses the game board etc; I now finished 60% of the course.


60% COMPLETE

I added a couple of new things that I will be explaining. 

  • The first thing I added was errors. There were three types. The types were if the person misses the game board completely, guessing wrong, or just guessing that number already. 

"OOPS YOUR GUESS WASN'T IN RANGE" MESSAGE

On line  31-35, I used else, if, variables, and range codes to make a message that says "You missed my battleship!" if the guess wasn't in range of the game board.

YOU GUESSED THAT ONE ALREADY MESSAGE

On line 35, I added a new one that says if the user guessed that number already then, it would say "You missed my battleship" like the photo above.

"GAME OVER" AND "NUMBER OF TURNS ALLOWED"

The code I added allows the user to guess 4 times before the game states that "it's over." The work I did was on line 43-44.

As you can see, all the codes I used in this exercise were ones that I already learned before and should not seem as foreign as one may think.

And I will show photos of my overall finished codes, within this whole exercise.


PART 1 OF FINISHED PRODUCT

PART 2 OF FINISHED PRODUCT



WHAT I LEARNED:


Surprisingly, I did learn something new today. I got taught a new code/command. And that is the break code. Basically, using this code for the battleships game, it stops the game after you guess it right without using all 4 turns. 

Before, without using the break code, the game kept going even if you guessed it right. So that's what the break function's purpose is in this situation.

BREAK FUNCTION

This was the only little thing I learned today, as this was mainly a 'practice-type' lesson.



WHAT I WILL BE DOING TOMORROW / NEXT TIME:


Next time I will move onto a completely new unit. It is titled loops, and as it is a new unit I can't say much, so I will just show the description.

LOOPS UNIT




Thursday 7 November 2019

Python - Day Seventeen (November)

WHAT I DID TODAY / LEARNED:


Today I started the exercise lesson 'Battleships.' I actually had to make a very small Battleships game (but just full on coding text version). For people who don't know, the objective of battleships is to guess a certain number in order to sink the battleship. Look at the picture below for an example of it if you don't know what it is.


BATTLESHIPS GAME EXAMPLE




Today I did half of the lessons as intended, and got as far as to making the base of the game, where the person can guess the number, the computer choosing a random battleship number, and if they guess it right, it leaves a congratulations message.

WHERE I LEFT OFF


Since I didn't learn anything I'll do a more detailed explanation of what each section of code does.

  • So first I had to make the base of the game board. This is seen on line 3-12. I created 5x5 rows/columns of the letter O's, using variables, def, and for and in.

  • After that I had to make the game board have an actual battleship to sink. This is seen on line 14-21. I had to make the code choose random rows and columns to place the battleship.

  • Third step, I had to add int(raw_input) to let the user actually type a number in to guess. The codes for this was only on lines 22 and 23.
THE RESULT/OTHER SIDE OF CODE

  • The fourth step was to print out ''Congratulations" message once the user has sunk the battleship. This code is located on line 29-30.


I did not learn anything new today, and just used the codes/functions I already learned. For example, to make this so far, all I had to do was use variables, print, and def, etc; So that's why I decided to combine the two sections of what I learned and what I did today together.



WHAT I WILL BE DOING TOMORROW / NEXT TIME:


Next time I will finish the other 9 lessons in 'Battleships', as I only completed 10/19.
REMAINING LESSONS

Tuesday 5 November 2019

Python - Day Sixteen (November)

WHAT I DID TODAY:


Today I completed the remaining 8 lessons I didn't complete last time in the 'Lists & Functions' Unit. I started noticing a pattern with Code Academy. In the very beginning when I started, I feel like they introduced me bits and pieces to what I'll be learning with the units. I think it's a very good idea because when starting on these units, I'm already somewhat familiar with these codes as I've been shown and introduced to it before. 

Today I completed this unit, now leaving me with 55% of the course completed.


55% COMPLETE


As usual, there was a review at the end. It was very simple, I just had to print out a list and add them together.

FINAL REVIEW


WHAT I LEARNED:



I only learned one COMPLETELY NEW thing/code today. The lessons within this unit were more of a review because I remember doing list related codes and functions often in the other units if I remember correctly.

  • The one thing I learned was the range() code. I can't say much about it but the name itself is pretty self explanatory. It takes the range of the number you input in to perform other actions. 

RANGE EXAMPLE

In the example above, on line 2 and 6, I put my range as 0-3. 3 as in meaning it stops before it reaches 3. I'm still a bit iffy on how that works, but I'm sure I'll learn more about what and how to use that code for later on.


Besides that though, Code Academy also shared a few new things about that range code. Or it was a thing to help people understand more. 

MORE ON RANGE FUNCTION

Like I said before, I haven't done much with this code yet, so it's a bit difficult to say much about it. 


WHAT I WILL BE DOING TOMORROW / NEXT TIME:


Next time I will be moving onto the new unit, 'Battleships.' Or 'exercise lesson' you can call it. If the title already didn't reveal everything, here is the description of the exercise.

DESCRIPTION OF NEXT EXERCISE

And there are 19 total lessons, or 'steps' in this exercise. I will see what I can get done, but I'm aiming to do the half-half thing again, where I split the lessons in half in two separate days.


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 ...