Professional Documents
Culture Documents
IT Assignment - 2
IT Assignment - 2
CO2
3. Variables: Variables are named containers used to store data values in a program. They
provide a way to manipulate and reference data during program execution. Variables have a
name, a data type (such as integer, string, or boolean), and a value that can be assigned or
modified. For example, in Python, you can declare a variable named "age" and assign it a
value like 25: `age = 25`.
4. Constants: Constants are similar to variables but hold values that cannot be changed
once they are assigned. They are used to represent fixed or immutable data in a program.
Constants are often defined using uppercase letters to distinguish them from variables. For
example, a constant representing the value of pi could be defined as `PI = 3.14159`.
It's worth noting that the specifics of programming environments, keywords, variables,
constants, and operators may vary depending on the programming language being used.
Different programming languages have their own set of rules and syntax for these elements.