Python Variables & Data Types
When I first started learning about variables in Python, I honestly found them a bit confusing. I kept wondering why we needed to give information a name and how the variable name was different from the value stored in it. At first, I thought they were almost the same thing, and I sometimes struggled to understand how Python used them. But as I started practising and writing my own code, things slowly became clearer.
One thing I have learned is that a variable is simply a name we give to information so we can store it and use it whenever we need it. I also learned that variables can hold different kinds of information depending on their data type.
So far, I have worked with str, int, and float. Strings are used for text, integers are whole numbers, while floats are numbers with decimal points.
The data type that feels most natural to me is str because working with names, words, and sentences feels easier to understand. I found it interesting that Python can also tell us the type of information stored in a variable using type(). Practising this helped me understand the lesson better.
I won't say everything is completely clear yet, but I can see the difference between what I understood at the beginning and what I know now. I am learning to be more comfortable with writing code, making mistakes, correcting them, and trying again.
