In python, there are both integers and floats. Integers are the same thing in python—a whole number. A float however, has its own meaning in python. A float in python is a function that helps to keep the number in a decimal format instead of having it as a whole number.
I also learnt about slicing today. In order for slicing as a function to work in python, you need to have a string. What slicing does is it helps to divide up the string into smaller fragments. In class today, we took the month name ‘October’ as our ‘string’. We chose the slicing ratio, to see which letters we wanted to show up when we ran the code. Once we inputted our slicing settings, the code would then pick out the letters that you want. In order to choose the length of your slice, you will need to change the ratio so the code can pick out the correct amount of letters in that string.
One other important thing I learnt about today is a loop. A loop is some code that tells the program what to do until it meets certain conditions. When you visualize it in real life, it becomes more like a flowchart. The program can only advance when certain conditions are met. If those conditions are not met, then the program would have to go back to the previous step and keep running the code until those conditions are met.
To conclude, today’s session was extremely interesting, as I have learnt about a lot of skills and functions that I can apply to other situations such as games, conversations, and much more!