okay I'm rewriting this blog post, I originally had 15 words with definitions but I'll only use 4 now because I'm tired and my laptop is gonna die ahhh
1. Variable
A variable is a storage location in a computer program, which has a name and can hold a value. This value can change (hence the term "variable"). For example, in the statement `x = 5`, `x` is a variable that stores the value `5`.
2. Data Type
A data type defines the kind of data that can be stored and manipulated within a program. Common data types include:
- Integer (int): Represents whole numbers (e.g., `5`, `-3`).
- Float: Represents decimal numbers (e.g., `3.14`, `-2.0`).
- String (str): Represents sequences of characters (e.g., `"hello"`, `"123"`).
- Boolean (bool): Represents truth values, either `True` or `False`.
3. Function
A function is a block of code designed to perform a particular task. Functions take inputs (called arguments or parameters), process them, and return an output. For example, in Python, `def add(a, b): return a + b` defines a function that adds two numbers.
4. Loop
A loop is a programming construct that repeats a block of code as long as a specified condition is true. The two main types of loops are:
- For Loop: Iterates over a sequence (like a list or range) a specific number of times.
- While Loop: Repeats as long as a condition remains true.
---------------
okay my laptop is gonna die any sec now but yes gonna rework this blog post tomorrow :,,)
Comments
Displaying 1 of 1 comments ( View all | Add Comment )
cinnamonlamb
this really gives logic and algorithms subject vibes
Report Comment