DEV Community

Cover image for #100DaysOfSwift: Day 3
KeeyboardKeda
KeeyboardKeda

Posted on

#100DaysOfSwift: Day 3

Day threeeeee! Hello! Today, was a review for me as I went over the following material when doing codecademy:

  1. Operators: compound assignment, comparison, ternary, comparison, and ranges.
  2. Switch statements
  3. Conditions
  4. Combining conditions

New things I learned:

  1. You can compare strings using less than or equal to operators. For example, "Taylor" <= "Swift". I did not understand how at first and then I read that strings have a natural alphabetical order!
  2. There are two types of range operators: i. half open range which is when you want to count up a certain number but not include that number. The syntax is two periods and a less than sign. For example, 1..<4 would be 1,2,3. ii. closed range is when you count up to a certain number and want to include that last number.The syntax is three periods. For example, 1...4 would be 1,2,3,4.

Until tomorrow !

Top comments (0)