computer term-2 7
computer term-2 7
computer memory.
A variable that is not initialized ever has an undefined value. Such a variable cannot be used until it is
assigned with a certain value.
1. Integer
2. Floating-Point Number
3. String
4. Boolean
Integer
Integer is a data type used to define integer variables. Integers can be of any length.
Floating-Point Number
A floating-point number in Python is used to define decimal numbers and is. accurate up to 15 decimals
places.
String
Boolean
Boolean data in Python is used to define Boolean variables. Boolean variables can hold only two values
in it, either "true" or "false".
Addition
Addition operation is used to perform mathematical addition of two variables. In programming, we refer
to "+" as a symbol of addition.
Multiplication
Division
Division operation is used to perform the mathematical division of two variables. In programming, we
refer to "/" as a symbol of division.
Modulus
Modulus operation is used to perform the mathematical remainder of two variables. In programming,
we refer to "%" as a symbol of modulus.
Subtraction
Sequencing
There are three basic building blocks that can be used when designing algorithms:
●Sequencing
●Selection
●Iteration
Step 1: Start
Step 7: Stop
: What is a Bug?
What would be the steps to draw a rectangle of length 5 cm and height 3 cm on your screen?
First, draw a line 5 cm in length
: While Loop
The While Loop can execute a set of commands till the condition is true.
: For Loop
Nested Loops
Selection refers to the situation in which the algorithm needs to make a choice between two or more
alternatives
Iteration refers to the process of doing the same task over and repeatedly, until a certain task is
complete, or a certain condition is met.
A function is a block of code made up of a set of steps that results in a single specific action.
: the variables accepted by a function to perform the set of tasks defined in its body are called function
parameters.
the usefulness of using a function in a program comes to the forefront, when an operation performed
inside a function. gives back a value, which can be used later in the program to generate meaningful
results.
What is an event?
An event handler is a piece of code associated with an event in the code. An event handler gets
executed, when that event occurs.