Round 3 Of The Year

In this round 3 of the year, we learn lots of new things in Multimedia class. We always have assignment after learning something new to practice and know more about it. All of the Multimedia classes uses Codeboard.io to do our assignments. Let me tell you about all of the stuff that we had learned.

  1. The first thing that we had learned is Boolean and it is a data type that can have value True or False. Example: “cat” is not “dog”. This is True because cats and dogs are different.
  2. The second thing that we had learned is Comparison. It is the same as math like to compare numbers, but the writing is a bit different and it look like this-
  • a == b (Equals)
  • a != b (Not Equals)
  • a < b (Less than)
  • a <= b (Less than or equal to)
  • a > b (Greater than)
  • a >= b (Greater than or equal to)
  1. The third thing that we had learned is the If Statement. We use it to make something happen if the code is the True condition. Example:
  2. a = 100
  3. b = 200
  4. if b < a:
  5.     Print “b is greater than a”
  6. The Fourth things that we had learned is indentation. It is the action of indenting or the state of being indented. It is important because if you put it in the wrong place, the code will be error. One of the right indentation is up there on the last example and this is the wrong indentation:
  7. a = 100
  8. b = 200
  9. if b < a:
  10. Print “b is greater than a”
  11. The fifth thing that we had learned is the Elif statement which is a statement with a condition contain value of neither True or False and it follow the If Statement. Example:
  12. a = 100
  13. b = 200
  14. if b < a:
  15.     Print “b is smaller than a”
  16. Elif b > a:
  17.     Print “b is greater than a”
  18. The sixth thing that we had learned is the Else statement and it is the similar to the Elif statement, just a little different that Else statement has no condition. Example:
  19. a = 100
  20. b = 200
  21. if b < a:
  22.     Print “b is smaller than a”
  23. Elif b == a:
  24.     Print “b is equal to a”
  25. Else:
  26.     Print “b is not smaller or equal to a”
  27. The seventh thing that we had learn is the AND, OR, NOT. We don’t just use it anytime that we want or else the code will be error. This is the table that my teacher, Cindy had made for us to understand it more clearly and I will share it with you because it is not easy for me to explain it to you. If you don’t understand it, this is the new topic that you have do study on your own. Sorry!
  AND OR NOT
Example X and Y X or Y Not X
Explanation True only if both X and Y are true True if either X or Y is true Flips the value of X
  1. The eighth thing that we had learned is the For loop. We use it to perform some actions a fixed number of times. Example:
  2. fruits = [‘banana’, ‘apple’,  ‘mango’]
    for fruit in fruits:       
      print ‘Current fruit :’, fruit
  3. The output will be
  4. Current fruit : banana
    Current fruit : apple
    Current fruit : mango
  5. The ninth thing that we had learned is the Break statement. We use this to stop the code when once the condition is true. Example:
  6. fruits = [“apple”, “banana”, “cherry”]
  7. for x in fruits:
  8.  print(x)
  9.  if x == “banana”:
  10.    break
  11. The output will be
  12. Apple
  13. Banana
  14. It is will stop at the banana because the condition is true and we have to break(stop).
  15. The tenth thing that we had learned is the Continue statement. It is the similar to the Break statement, but it is use to skip something when the condition is true. Example:
  16. fruits = [“apple”, “banana”, “cherry”]
  17. for x in fruits:
  18.  print(x)
  19.  if x == “banana”:
  20.    continue
  21. The output will be
  22. Apple
  23. Cherry because the condition is true, so it’s going to skip the banana.
  24. The eleventh thing that we had learned is the range function and we use it to count number.  Example:
  25. for x in range(5):
  26.  print(x)
  27. The output will be
  28. 0
  29. 1
  30. 2
  31. 3
  32. 4 because it tells to count up to five number and most computer start counting from 0. So, to tell the program to start counting from any number, we have to add something. Example:
  33. for x in range(2, 5):
  34.  print(x)
  35. The output will be
  36. 2
  37. 3
  38. 4.
  39. The twelfth thing that we had learned is the While loop and we use it to perform something while something is happening. It will repeat forever until the condition become True. Example:
  40. count = 0
    while (count < 9):
      print ‘The count is:’, count
      count = count + 1
  41. The thirteenth thing that we had learned is Infinite Loop and it will the code to go forever because there’s no condition. Example:
  42. i = 1
  43. while i < 6:
  44.  print(i)
  45. The output will just be
  46. 1
  47. 1
  48. 1
  49. 1
  50. 1
  51. 1
  52. 1
  53. 1
  54. 1
  55. 1 forever because there is no condition, but if there is any condition it will become the While loop.
  56. That’s all the thing that we had learned. I hope you heard something new. Thank You!

Leave a Reply

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