You are on page 1of 14

Republic of the Philippines

BATANGAS STATE UNIVERSITY


BatStateUAlangilan
Alangilan, Batangas City
College of Engineering, Architecture and Fine Arts
https://batstate-u.edu.ph/, Tel. No. (043) 425-0139 loc. 118/2121

1. VARIABLE

It's a storage container for data values. It is generated when you assign a value

to it for the first time. When you create a variable with the same name inside a function,

it becomes local and can only be used within the function.

2. PRINTING FUNCTION

The print() function sends a message to the screen or another device, or gadget

with standard output. The message can be a string or any other object, which will be

converted to a string before being displayed on the screen.

3. FUNCTION

A function is a collection of related statements that accomplishes a specific task.

Functions aid in the division of our program into smaller, modular chunks. As our program

grows in size, functions help to organize and manage it.


Republic of the Philippines
BATANGAS STATE UNIVERSITY
BatStateUAlangilan
Alangilan, Batangas City
College of Engineering, Architecture and Fine Arts
https://batstate-u.edu.ph/, Tel. No. (043) 425-0139 loc. 118/2121

4. LOOP FUNCTION

It is used to repeatedly execute a group of statements or the specific block of code

until the specified condition is satisfied. Looping is the process of repeating something

until a specific condition is met.

a. FOR loop is a control flow statement that is used to execute a group of

statements repeatedly as long as the condition is met.

b. WHILE loop is a control flow statement that allows code to be executed

multiple times based on a specified Boolean condition. The while loop is

similar to a looping if statement.

PilipinWHO? | 1
Republic of the Philippines
BATANGAS STATE UNIVERSITY
BatStateUAlangilan
Alangilan, Batangas City
College of Engineering, Architecture and Fine Arts
https://batstate-u.edu.ph/, Tel. No. (043) 425-0139 loc. 118/2121

5. IF STATEMENT

It is the core of the decision-making statement. It tells the program to only run a

block of code if a specific condition is met. If statements are control flow statements that

allow us to run code only when a certain condition is met. If you want to print a message

on the screen only when a condition is true, you can use the if statement in

programming to do so.

6. IF-ELSE STATEMENT

In the Python language, the keywords if and else are used to execute one block

of statements among two blocks. If is used when the condition is true, while otherwise is

used when the condition is false.

PilipinWHO? | 2
Republic of the Philippines
BATANGAS STATE UNIVERSITY
BatStateUAlangilan
Alangilan, Batangas City
College of Engineering, Architecture and Fine Arts
https://batstate-u.edu.ph/, Tel. No. (043) 425-0139 loc. 118/2121

7. ELIF STATEMENT

Elif is a short form of "else if," and it allows us to explore many expressions at

once. If the if condition is incorrect, the condition of the next elif block is checked, and

so on. If any of the conditions are incorrect, the content of the else is executed.

8. ARITHMETIC OPERATOR

It is used to execute addition, subtraction, multiplication, and division arithmetic

operations. Some languages have arithmetic operators that other languages do not. For

example, in division operations, the modulus operator returns the remaining value.

PilipinWHO? | 3
Republic of the Philippines
BATANGAS STATE UNIVERSITY
BatStateUAlangilan
Alangilan, Batangas City
College of Engineering, Architecture and Fine Arts
https://batstate-u.edu.ph/, Tel. No. (043) 425-0139 loc. 118/2121

9. COMPARISON OPERATOR

It's used to compare data. Equal, not equal, greater than, less than, greater than

or equal to, and less than or equal to are some of the options.

F. SOURCE CODE

PilipinWHO? | 4
Republic of the Philippines
BATANGAS STATE UNIVERSITY
BatStateUAlangilan
Alangilan, Batangas City
College of Engineering, Architecture and Fine Arts
https://batstate-u.edu.ph/, Tel. No. (043) 425-0139 loc. 118/2121

PilipinWHO? | 5
Republic of the Philippines
BATANGAS STATE UNIVERSITY
BatStateUAlangilan
Alangilan, Batangas City
College of Engineering, Architecture and Fine Arts
https://batstate-u.edu.ph/, Tel. No. (043) 425-0139 loc. 118/2121

PilipinWHO? | 6
Republic of the Philippines
BATANGAS STATE UNIVERSITY
BatStateUAlangilan
Alangilan, Batangas City
College of Engineering, Architecture and Fine Arts
https://batstate-u.edu.ph/, Tel. No. (043) 425-0139 loc. 118/2121

PilipinWHO? | 7
Republic of the Philippines
BATANGAS STATE UNIVERSITY
BatStateUAlangilan
Alangilan, Batangas City
College of Engineering, Architecture and Fine Arts
https://batstate-u.edu.ph/, Tel. No. (043) 425-0139 loc. 118/2121

PilipinWHO? | 8
Republic of the Philippines
BATANGAS STATE UNIVERSITY
BatStateUAlangilan
Alangilan, Batangas City
College of Engineering, Architecture and Fine Arts
https://batstate-u.edu.ph/, Tel. No. (043) 425-0139 loc. 118/2121

PilipinWHO? | 9
Republic of the Philippines
BATANGAS STATE UNIVERSITY
BatStateUAlangilan
Alangilan, Batangas City
College of Engineering, Architecture and Fine Arts
https://batstate-u.edu.ph/, Tel. No. (043) 425-0139 loc. 118/2121

PilipinWHO? | 10
Republic of the Philippines
BATANGAS STATE UNIVERSITY
BatStateUAlangilan
Alangilan, Batangas City
College of Engineering, Architecture and Fine Arts
https://batstate-u.edu.ph/, Tel. No. (043) 425-0139 loc. 118/2121

PilipinWHO? | 11
Republic of the Philippines
BATANGAS STATE UNIVERSITY
BatStateUAlangilan
Alangilan, Batangas City
College of Engineering, Architecture and Fine Arts
https://batstate-u.edu.ph/, Tel. No. (043) 425-0139 loc. 118/2121

PilipinWHO? | 12
Republic of the Philippines
BATANGAS STATE UNIVERSITY
BatStateUAlangilan
Alangilan, Batangas City
College of Engineering, Architecture and Fine Arts
https://batstate-u.edu.ph/, Tel. No. (043) 425-0139 loc. 118/2121

PilipinWHO? | 13

You might also like