What I learned this week
Algorithms -3.3 & 3.4
- It is a step by step procedures or set of rules used to solve problems or perform tasks (aka, sequencing)
- Iteration: Repetition;loop
- Fibonacci: A fibonacci sequence is a series of numbers in which each number is the sum of the two preceding ones. It commonly starts with 0 and 1, and the sequence continues infinitely. the first few numbers in the finacci sequence are : 0,1,1,2,3,5,8,13,21,34
- Factorial: 5! = 54321 = 120 len(str) countes the number of characters in a string; also works for lists
- Substring example string = “Hello, world!” Substring - string[2:10] print(substring) result: llo, wor
Booleans If
- True or False
- NOT condition: flips what is currently stored in the variable without impacting the variable/condition itself
-eg.
israining --> true x --> not israining x --> false
- AND condition: checks both conditions to produce one single Boolean true or false
- OR condition: checks whether or not one of the conditions is true or false