2. Definition of Constant:
As the name implies, the constant is a value that remains
constant ever. Constant has a fixed value and its value cannot
be changed by any variable. Constants are represented by
numbers.
For example in the algebraic expression 3x + 5y = 7, where 7 is
the constant we know its face value is 7 and it cannot be
changed. But 3x and 5y are not constants because the variable
x and y can change their value.
3. Definition of Variable:
A value that keeps on changing is said to be variable. Variables
are often represented by an alphabet like a, b, c, or x, y, z.
Its value changes from time to time.For example in the
Algebraic Expression:3x + 5y = 7 where x and y are variables
that are changed according to the expression.
4. Declaration of constants and variables in pseudocode
Declare FirstVar : INTEGER
Declare SecondVar : INTEGER
CONSTANT FirstConst 500
CONSTANT SecondConst 100
Declaration of constants and variables in python
FirstVar = 20
SecondVar = 10
FirstConst = 500
SecondConst = 100
5. Text Type: str
Numeric
Types:
int, float, complex
Sequence
Types:
list, tuple, range
Boolean
Type:
bool
Python has the following data types built-in by
default, in these categories:
6. INPUT STATEMENT IN PYTHON
x = input('Enter your name:')
print('Hello, ' + x)
7. program to add two numbers
num1 = 1.5
num2 = 6.3
# Add two numbers
sum = num1 + num2
# Display the sum
print('The sum of two numbers is’ ,+sum)