INTRODUCTIO
N
CpE 401- Computer Programming 1
Agenda
1 2 3 4 5
Syllabus Introduction Python IDE Basic Syntax Basic
Input/Output
2 Presentation title 20XX
Syllabus
Course Title Computer Programming 1
Course Category Allied Course
Semester/year Second Semester / 2024-2025
Camille Joy C. Sosa 55703
Course Instructor Lecturer I
camille.joy.sosa@g.batstate-u.edu.ph/09155842098
3
Syllabus
Course Code CpE 401
Prerequisite(s) Second Year Standing
Credit Hours 3 hours lab
4
Syllabus
Criteria for Major Exam - 20%
Assessment Laboratory Assessment - 50%
Quiz - 10%
Final Project - 20%
5
Syllabus
Intended ILO Upon completion of this course, the students should be able to:
Learning ILO1 Understand fundamental Python programming concepts aligned
Outcomes with engineering programming solutions.
(ILO) ILO2 Analyze visualization of program flow to design solutions for
engineering tasks.
ILO3 Create a simple console-based Python project for applying
programming skills to real-world engineering applications.
6
Syllabus
7
Syllabus
8
Syllabus
9
Syllabus
10
Syllabus
11
Syllabus
12
Syllabus
13
Syllabus
14
INTRODUCTION
What is Computer Programming?
• Programming or Computer programming is a way of giving an
instruction to a computer to perform a specific task. In programming
world, it often refer to as coding.
• A sequence of instruction that a computer is executing is called
computer program. A set of computer programs can create a
software.
INTRODUCTION
Programming Languages
• A quest to provide a common language that a computer and human
will understand leads to the development of programming
languages. There are a lot of programming language that have been
develop but all of these are divided into two types; Low-level
Language and High-Level Language.
• Low-Level Languages - It has no abstraction and the
programming rely closely to the computer architecture. To create a
program using a low-level language, the programmer must
understand the architecture of the computer system such as the
number of registers, the size of memory, register and cache, how
the device are connected to each other, how many instruction the
machine is capable and what are these instructions.
INTRODUCTION
Programming Languages
• Low level program codes are divided into two parts. the opcode and
the operand.
• High- Level Languages - It has a high-level of abstraction and
focus mainly on the programming logic rather than the underlying
hardware architecture. It is more user friendly and generally
independent from the computer hardware.
INTRODUCTION
Python Programming Language
• Python is a high-level programming
language. Open source and community
driven. Source can be compiled or run
just-in-time. Similar to perl, tcl, ruby
INTRODUCTION
Why Python?
• It has simplified syntax and not
complicated, which gives more emphasis
on natural language.
INTRODUCTION
Python Syntax
is shorter
PYTHON PRINT
STATEMENT
>>> print("Hello World")
Hello World
>>>
INTRODUCTION
Python IDE
• An integrated development environment (IDE) is a
software application that provides comprehensive
facilities for software development.
INTRODUCTION
LET’S SET UP OUR VSCODE IDE
START
DEMO
INTRODUCTION
Python Basic Terms
• A variable stores data that can be
used and updated later.
INTRODUCTION
Identifiers and Naming Rules
in Python
• Valid
Start with a letter or an underscore (_)
Python Basic Examples
Terms
• Identifiers are the
names used to identify Invalid
variables, functions, Examples
classes, and other objects
in Python.
INTRODUCTION
Identifiers and Naming Rules
in Python
• Valid
Only letters, numbers, and underscores are allowed
Python Basic Examples
Terms
• Identifiers are the
names used to identify Invalid
variables, functions, Examples
classes, and other objects
in Python.
INTRODUCTION
Identifiers and Naming Rules
in Python
• Valid
Cannot contain spaces
Python Basic Examples
Terms
• Identifiers are the
names used to identify Invalid
variables, functions, Examples
classes, and other objects
in Python.
INTRODUCTION
Identifiers and Naming Rules
in Python
• Case-sensitive: Python treats uppercase and
Python Basic Examples
lowercase letters as different.
Terms
• Identifiers are the
names used to identify
variables, functions,
classes, and other objects
in Python.
INTRODUCTION
Identifiers and Naming Rules
in Python
• Valid
Cannot use Python keywords or reserved words
Python Basic Examples
Terms
• Identifiers are the
names used to identify Invalid
variables, functions, Examples
classes, and other objects
in Python.
INTRODUCTION
Python Basic
Terms
• Keywords are reserved
words in Python that have
specific meanings.
• Cannot be used as
variable names.
INTRODUCTION
Python Basic Terms
• Data types is defined as the type
of data a variable holds.
INTRODUCTION
Python Basic
Terms
• Python uses indentation to
define blocks of code instead
of braces {}.
• It is mandatory in Python.
INTRODUCTION
Python Basic
Terms
• Exception an error that
occurs during the execution of
a program.
• Can be handled using try and
except.
INTRODUCTION
What is INPUT and OUTPUT?
• Input: Getting data from the user during program execution.
• Output: Displaying data or results to the user.
INTRODUCTION
Output in Python
• Use the print() function to display information on the screen.
• Can handle multiple items separated by commas.
INTRODUCTION
Formatting Output in Python
• Use f-strings for clean and readable formatting
INTRODUCTION
Formatting Output in Python
• Or use str.format() method:
INTRODUCTION
Formatting Output in Python
• Left Align text : <15
OUTPUT:
{name:<15}: Aligns name to the left within a 15-
character field.
INTRODUCTION
Formatting Output in Python
• Right Align text : >15
OUTPUT:
{name:>15}: Aligns name to the right within a 15-
character field.
INTRODUCTION
Formatting Output in Python
• Align with decimals
OUTPUT:
INTRODUCTION
Formatting Output in Python
• Align with decimals
OUTPUT:
INTRODUCTION
LET’S DO YOUR FIRST PROGRAM
START
DEMO
INTRODUCTION
DEMO CODE
INTRODUCTION
DEMO CODE
ANNOUNCEMENT
"We will be conducting our first activity
during the scheduled face-to-face
meeting."
THANK YOU
CpE 401- Computer Programming 1