0% found this document useful (0 votes)
35 views39 pages

Week 1 - Introduction To Python

The document discusses an introduction to Python programming for businesses. It covers topics like hardware and software components, how computers store data, and how programs work. It then discusses why Python is useful for businesses, providing examples of its versatility, productivity, extensive ecosystem, and cost-effectiveness.

Uploaded by

Rani Muniandy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views39 pages

Week 1 - Introduction To Python

The document discusses an introduction to Python programming for businesses. It covers topics like hardware and software components, how computers store data, and how programs work. It then discusses why Python is useful for businesses, providing examples of its versatility, productivity, extensive ecosystem, and cost-effectiveness.

Uploaded by

Rani Muniandy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 39

G0234 PYTHON PROGRAMMING IN

BUSINESS

Week 1 – Introduction to Python


Topics

• Introduction
• Hardware and Software
• How Computers Store Data
• How a Program Works
• Using Python

© 2020 Epistemy Press All rights reserved. / Page 2


Why Python for Businesses
Versatility
▪ Suitable for various applications such as web Integration capabilities
▪ Easily integrates with other technologies and
development, data analysis, AI, and automation.
systems.
Productivity
▪ Simple syntax leads to faster development cycles and Data analysis and ML

quicker time-to-market.
Robust libraries enable efficient data analysis and
machine learning.
Extensive ecosystem
▪ Large library support accelerates development and Community support:
▪ Access to a large and active community for
provides solutions for diverse tasks.
assistance and resources.
Cost-effectiveness
▪ Open-source nature reduces licensing fees and offers
abundant free resources.

Scalability
▪ Adaptable for businesses of all sizes, from startups to
large enterprises.

© 2020 Epistemy Press All rights reserved. / Page 3


Case Study – Small Medium Enterprise (SME)

▪ SME stands for "Small and Medium-sized Enterprises.“


▪ It refers to businesses that fall within a certain size range in
terms of employees, revenue, or other criteria, which varies
by country.
▪ Generally, SMEs have fewer employees and lower revenue
compared to larger corporations.
▪ They are often considered the backbone of many
economies worldwide due to their significant contributions to
employment, innovation, and economic growth.
▪ SMEs can encompass a wide range of industries and
sectors, including manufacturing, services, technology, and
more

© 2020 Epistemy Press All rights reserved. / Page 4


SME’s in Malaysia
SMEs in Malaysia are defined based on employee count and annual sales turnover.

They contribute significantly to Malaysia's GDP and employ a large portion of the workforce.

SMEs operate across diverse sectors including manufacturing, services, agriculture, and technology.

The government provides support through various initiatives including financial assistance and capacity-building
programs.

Challenges faced by SMEs include limited access to financing, skills shortages, and market competition.

Internationalization efforts are encouraged, with support available for SMEs looking to expand globally.

Overall, SMEs are crucial for Malaysia's economic growth, innovation, and employment generation.

© 2020 Epistemy Press All rights reserved. / Page 5


SME’s in Malaysia

© 2020 Epistemy Press All rights reserved. / Page 6


SME’s by State

https://slideplayer.com/slide/12897939/
© 2020 Epistemy Press All rights reserved. / Page 7
Challenges of SME’s

Access to Financing: Many SMEs struggle to secure funding from financial institutions due to lack of collateral,
credit history, or high-risk perceptions, hindering their growth and expansion plans.

Skills Shortages: SMEs often face difficulties in recruiting and retaining skilled employees, especially in
specialized fields such as technology, engineering, and digital marketing, which can limit their ability to innovate
and compete effectively.

Market Competition: SMEs must contend with intense competition from larger corporations, both domestically
and internationally, which may have greater resources, economies of scale, and market presence.

Regulatory Burdens: Compliance with regulatory requirements and bureaucratic procedures can be
cumbersome for SMEs, consuming time, effort, and financial resources that could otherwise be allocated to
business development and growth initiatives.

© 2020 Epistemy Press All rights reserved. / Page 8


Challenges of SME’s

Digitalization Barriers: Many SMEs struggle with adopting and integrating digital technologies into their
operations, such as e-commerce platforms, data analytics tools, and cloud-based services, which are
increasingly essential for staying competitive in today's digital economy.

Access to Markets: Limited access to domestic and international markets can impede SMEs' growth prospects,
particularly for those operating in niche industries or lacking networks and distribution channels.

Infrastructure Constraints: Inadequate infrastructure, such as transportation networks, logistics facilities, and
digital connectivity, can hinder SMEs' ability to operate efficiently and reach customers, especially in rural or
remote areas.

Rising Costs: SMEs face rising costs of production, including labor, raw materials, utilities, and overhead
expenses, which can erode profit margins and strain financial viability, particularly during economic downturns or
periods of inflation.

© 2020 Epistemy Press All rights reserved. / Page 9


Main Challenges - Digital Transformation

Because of failing to transform Digitally :


▪ Unable to process data – to information
▪ Unable to analyse Data
▪ Poor decision making

Then Finally, Statistic shows, - Every 5 years – 10% of SMEs Failed

Now, Reflecting to SME’s Case Study, How do you think that Python can be helpful to them ?
▪ Manufacturing Sectors
▪ Service Sectors

© 2020 Epistemy Press All rights reserved. / Page 10


Introduction

• Computers can be programmed


▪ Designed to do any job that a program tells them to
• Program: set of instructions that a computer follows to perform a task
▪ Commonly referred to as Software
• Programmer: person who can design, create, and test computer programs
▪ Also known as software developer

© 2020 Epistemy Press All rights reserved. / Page 11


Hardware and Software

• Hardware: The physical devices that make up a computer


▪ Computer is a system composed of several components that all work together
• Typical major components:
▪ Central processing unit
▪ Main memory
▪ Secondary storage devices
▪ Input and output devices

© 2020 Epistemy Press All rights reserved. / Page 12


The CPU

• Central processing unit (CPU): the part of the computer that actually runs
programs
▪ Most important component
▪ Without it, cannot run software
▪ Used to be a huge device
• Microprocessors: CPUs located on small chips

© 2020 Epistemy Press All rights reserved. / Page 13


Main Memory

• Main memory: where computer stores a program while program is running,


and data used by the program
• Known as Random Access Memory or RAM
▪ CPU is able to quickly access data in RAM
▪ Volatile memory used for temporary storage while program is running
▪ Contents are erased when computer is off

© 2020 Epistemy Press All rights reserved. / Page 14


Secondary Storage Devices

▪ Secondary storage: can hold data for long periods of time


▪ Programs normally stored here and loaded to main memory when needed
▪ Types of secondary memory
▪ Disk drive: magnetically encodes data onto a spinning circular disk
▪ Solid state drive: faster than disk drive, no moving parts, stores data in solid
state memory
▪ Flash memory: portable, no physical disk

© 2020 Epistemy Press All rights reserved. / Page 15


Input Devices

• Input: data the computer collects from people and other devices
• Input device: component that collects the data
▪ Examples: keyboard, mouse, touchscreen, scanner, camera
▪ Disk drives can be considered input devices because they load programs into
the main memory

© 2020 Epistemy Press All rights reserved. / Page 16


Output Devices

• Output: data produced by the computer for other people or devices


▪ Can be text, image, audio, or bit stream
• Output device: formats and presents output
▪ Examples: video display, printer
▪ Disk drives and USB drives can be considered output devices because data is
sent to them to be saved

© 2020 Epistemy Press All rights reserved. / Page 17


Software (1 of 2)

• Everything the computer does is controlled by software


▪ General categories:
▪ Application software
▪ System software
• Application software: programs that make computer useful for every day
tasks
▪ Examples: word processing, email, games, and Web browsers

© 2020 Epistemy Press All rights reserved. / Page 18


Software (2 of 2)

• System software: programs that control and manage basic operations of a


computer
▪ Operating system: controls operations of hardware components
▪ Utility Program: performs specific task to enhance computer operation or
safeguard data
▪ Software development tools: used to create, modify, and test software
programs

© 2020 Epistemy Press All rights reserved. / Page 19


How Computers Store Data

• All data in a computer is stored in sequences of 0s and 1s


• Byte: just enough memory to store letter or small number
▪ Divided into eight bits
▪ Bit: electrical component that can hold positive or negative charge, like on/off
switch
▪ The on/off pattern of bits in a byte represents data stored in the byte

© 2020 Epistemy Press All rights reserved. / Page 20


Storing Numbers

• Bit represents two values, 0 and 1


• Computers use binary numbering system
▪ Position of digit j is assigned the value 2j-1
▪ To determine value of binary number sum position values of the 1s
• Byte size limits are 0 and 255
▪ 0 = all bits off; 255 = all bits on
▪ To store larger number, use several bytes

© 2020 Epistemy Press All rights reserved. / Page 21


Storing Characters

• Data stored in computer must be stored as binary number


• Characters are converted to numeric code, numeric code stored in memory
▪ Most important coding scheme is ASCII
▪ ASCII is limited: defines codes for only 128 characters
▪ Unicode coding scheme becoming standard
▪ Compatible with ASCII
▪ Can represent characters for other languages

© 2020 Epistemy Press All rights reserved. / Page 22


Advanced Number Storage

• To store negative numbers and real numbers, computers use binary


numbering and encoding schemes
▪ Negative numbers encoded using two’s complement
▪ Real numbers encoded using floating-point notation

© 2020 Epistemy Press All rights reserved. / Page 23


Other Types of Data

• Digital: describes any device that stores data as binary numbers


• Digital images are composed of pixels
▪ To store images, each pixel is converted to a binary number representing the
pixel’s color
• Digital music is composed of sections called samples
▪ To store music, each sample is converted to a binary number

© 2020 Epistemy Press All rights reserved. / Page 24


How a Program Works (1 of 3)

• CPU designed to perform simple operations on pieces of data


▪ Examples: reading data, adding, subtracting, multiplying, and dividing
numbers
▪ Understands instructions written in machine language and included in its
instruction set
▪ Each brand of CPU has its own instruction set
• To carry out meaningful calculation, CPU must perform many operations

© 2020 Epistemy Press All rights reserved. / Page 25


How a Program Works (2 of 3)

• Program must be copied from secondary memory to RAM each time CPU
executes it
• CPU executes program in cycle:
▪ Fetch: read the next instruction from memory into CPU
▪ Decode: CPU decodes fetched instruction to determine which operation to
perform
▪ Execute: perform the operation

© 2020 Epistemy Press All rights reserved. / Page 26


How a Program Works (3 of 3)

Figure 1-16 The fetch-decode-execute cycle

3 - 27
From Machine Language to Assembly Language

• Impractical for people to write in machine language


• Assembly language: uses short words (mnemonics) for instructions instead
of binary numbers
▪ Easier for programmers to work with
• Assembler: translates assembly language to machine language for
execution by CPU

© 2020 Epistemy Press All rights reserved. / Page 28


High-Level Languages

• Low-level language: close in nature to machine language


▪ Example: assembly language
• High-Level language: allows simple creation of powerful and complex
programs
▪ No need to know how CPU works or write large number of instructions
▪ More intuitive to understand

© 2020 Epistemy Press All rights reserved. / Page 29


Keywords, Operators, and Syntax: an Overview

• Keywords: predefined words used to write program in high-level


language
▪ Each keyword has specific meaning
• Operators: perform operations on data
▪ Example: math operators to perform arithmetic
• Syntax: set of rules to be followed when writing program
• Statement: individual instruction used in high-level language

© 2020 Epistemy Press All rights reserved. / Page 30


Compilers and Interpreters (1 of 3)

• Programs written in high-level languages must be translated into machine


language to be executed
• Compiler: translates high-level language program into separate machine
language program
▪ Machine language program can be executed at any time

© 2020 Epistemy Press All rights reserved. / Page 31


Compilers and Interpreters (2 of 3)

• Interpreter: translates and executes instructions in high-level language


program
▪ Used by Python language
▪ Interprets one instruction at a time
▪ No separate machine language program
• Source code: statements written by programmer
▪ Syntax error: prevents code from being translated

© 2020 Epistemy Press All rights reserved. / Page 32


Compilers and Interpreters (3 of 3)

Figure 1-19 Executing a high-level program with an interpreter

3 - 33
Using Python

• Python must be installed and configured prior to use


▪ One of the items installed is the Python interpreter
• Python interpreter can be used in two modes:
▪ Interactive mode: enter statements on keyboard
▪ Script mode: save statements in Python script

© 2020 Epistemy Press All rights reserved. / Page 34


Interactive Mode

• When you start Python in interactive mode, you will see a prompt
▪ Indicates the interpreter is waiting for a Python statement to be typed
▪ Prompt reappears after previous statement is executed
▪ Error message displayed If you incorrectly type a statement
• Good way to learn new parts of Python

© 2020 Epistemy Press All rights reserved. / Page 35


Writing Python Programs and Running Them in Script Mode

• Statements entered in interactive mode are not saved as a program


• To have a program use script mode
▪ Save a set of Python statements in a file
▪ The filename should have the .py extension
▪ To run the file, or script, type
python filename
at the operating system command line

© 2020 Epistemy Press All rights reserved. / Page 36


The IDLE Programming Environment

• IDLE (Integrated Development Program): single program that provides


tools to write, execute and test a program
▪ Automatically installed when Python language is installed
▪ Runs in interactive mode
▪ Has built-in text editor with features designed to help write Python programs

© 2020 Epistemy Press All rights reserved. / Page 37


Installation

▪ ..\..\..\FEB 24\PYTHON\lecture Notes\Lecture_01 (Python).pdf

© 2020 Epistemy Press All rights reserved. / Page 38


Summary

• This chapter covered:


▪ Main hardware components of the computer
▪ Types of software
▪ How data is stored in a computer
▪ Basic CPU operations and machine language
▪ Fetch-decode-execute cycle
▪ Complex languages and their translation to machine code
▪ Installing Python and the Python interpreter modes

© 2020 Epistemy Press All rights reserved. / Page 39

You might also like