Python Basics: Variables and Arithmetic Operations

Yesterday, we officially started the Python class. Nothing fancy, Just foundations done right. We began with the print() statement, Using it to display outputs on the screen. We worked with: * Integers numbers without decimals * Strings text data For strings, we learned an important rule: Text must be wrapped in quotation marks (inverted commas). Example: print("Hello") Without quotation marks, Python treats it as a variable and throws an error. Then we moved into arithmetic operations: * Addition (+) * Subtraction (-) * Multiplication (*) Floor division (//) Divides numbers and returns only the whole number, ignoring decimals. Exponentiation (**) Raises a number to the power of another number. Modulus (%) Returns the remainder after division. Next, we introduced variables. A variable is a container that stores data values. We assign values to a variable. Example: x = 2 x is the variable 2 is the value Once that clicked, everything started to make sense. Students practiced assigning variables and carrying out arithmetic operations using those variables. Not memorizing syntax, But understanding what the code is doing. It was an interesting session, filled with questions and “ohhh, I get it now” moments. This is just the beginning. I’ll be sharing more real Python lessons and class updates as we continue. Follow closely for more Python lessons #Python #PythonBeginners #DataAnalysis #LearningInPublic #TechEducation #Foundations #JupyterNotebook

Thank you Mamoke Glory Not memorizing syntax but knowing what the code does 😎 That's worth noting. I will be patiently waiting for your next python class

Solid foundation, learning by doing

See more comments

To view or add a comment, sign in

Explore content categories