0% found this document useful (0 votes)
102 views

SIC Python Course Material

The document discusses Python and its popularity and uses. Python is an easy to learn programming language that is widely used in education and by companies like Google, Netflix, and Spotify. The document also discusses how Python supports machine learning and deep learning and can be used for both front-end and back-end development.

Uploaded by

volibe
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
102 views

SIC Python Course Material

The document discusses Python and its popularity and uses. Python is an easy to learn programming language that is widely used in education and by companies like Google, Netflix, and Spotify. The document also discusses how Python supports machine learning and deep learning and can be used for both front-end and back-end development.

Uploaded by

volibe
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 74

Chapter Description

Orientation

<Most loved languages in 2020>


Python Python C# C++ 33.10% 59.70%
JavaScript R Ruby 44.50% 44.10% 43.40% 42.90% 58.30%
Java C 66.70%

Orientation
‣ Python code can be written and interpreted similarly as human’s everyday language, so it is readable and easy to
learn by beginners. Students can design the flow of the program in human language and change it to the actual
Python code very easily.
‣ Especially the syntax of Python is very simple and intuitive to write and understand, which helps new programmers not
to waste time with confusing syntax.

Python syntax

Interpreted

Orientation
‣ Python is wanted not only in educational fields but also by many developers in professional workplaces. Big
companies, including Google, Intel, eBay, Netflix, Instagram, Dropbox, and Slack, utilize Python for developing and
maintaining their applications.

‣ Google uses Python software development to


<Major companies that use Python>
enhance its search engine capabilities.
‣ Netflix uses Python to recommend movies, TV shows, and
documentaries based on a user’s history.
‣ Instagram uses Python to personalize the explore
section for users.
‣ Spotify uses Python for personalized music
Majo recommendation to its users.
r companies that use Python ‣ Reddit uses Python for web development to simplify the
Q&A sections.

Orientation
‣ Python includes various libraries, such as pandas, NumPy, SciPy, Matplotlib, TensorFlow, and Keras, that can be
extensively used in different fields like web development, data analytics, and artificial intelligence.

‣ pandas is used for data manipulation and analysis,


<Python libraries>
particularly featuring numerical tables and time series
Major companies that use Python operation.
‣ NumPy supports for large, multi-dimensional arrays and
matrices, along with a collection of high-level mathematical
functions.
‣ TensorFlow is based on dataflow and differential
programming, which focuses on deep neural networks for
machine learning.
‣ Keras provides an interface for artificial neural networks with a
focus on enabling fast experimentation.

Orientation
‣ The 4th industrial revolution focuses on task automation, improved communication, and self-monitoring of smart
machines. Especially, machine learning and deep learning have been growing rapidly as the flower of the 4th
industrial revolution.
‣ As mentioned in the last slide, Python supports multiple libraries that engage in machine learning and deep
learning of artificial intelligence. It has been developing along with the progress of the 4 th industrial revolution, and it
plays a key role in enhancing in their rapid growth.

‣ Python also has different types of Python framework, such as Django, Flask, and FastAPI. With the utilization of
those frameworks and libraries, Python can be used in both front-end and back-end programming. It allows full
stack development, which is preferred in many job positions in related industries.

Orientation

Artificial Intelligence & Machine Learning Automation


Automate the simple tasks on the Software Testing and Prototyping Simplifying everyday tasks
computer through automation
Data Science Web Development Game Development
& ‣ Updating your grocery shopping list
Data Visualization ‣ Renaming large batches of files
‣ Converting text files to spreadsheets
‣ Filling out online forms automatically and
etc.

Orientation

IoT Course C&P Course AI Course


Basic Python

Algorithm for
Data Analysis

Orientation

IoT Course 8 IoT Project in Mobius Platform Ch 7 Preparation for Data Analysis
(Pandas Basics)
Ch 1 Understand IoT C&P Course Ch 8 Practice of Data Analysis and
for the 4th Industrial Revolution Data Visualization
AI Course
Ch 2 Raspberry Pi Hardware and Ch 1 Python Basic
Electrical Electronics
Ch 1 Introduction to AI
Ch 2 The Flower of Python Basics –
Ch 3 Git and Version Control Sequence Data Type Handling
Ch 2 Basic Algorithm for AI Learning
Ch 3 Python Intensive –
Ch 4 Programming Raspberry Pi in
Function and Closure
Python Ch 3 Practice Processing Data Ch 4

Ch 5 Linux for Network Connection Ch 4 Algorithm I –Data Structure Ch


Probability and Statistics Ch 5 Machine
Ch 6 Programming IoT Network 5 Algorithm I I– Sort
Connection Learning Part 1 Ch 6 Machine

Ch 7 Node.js for Internet Network Ch Ch 6 Algorithm –Graph and Others Learning Part 2 Ch 7 Machine
Learning Part 3 Ch 8 Deep Learning Part 1 Ch 9 Deep Learning Part 2

Unit learning objective (1/3) UNIT 01


Unit learning objective (2/3) UNIT 01
Unit learning objective (3/3) UNIT 01

Computational thinking Environment Jupyter Notebook


Virtual

Syntax
Annotation Sequential Structure
Naming
Conventions
Expressions
Error Runtime Error
UNIT 01

1.1. 47% of jobs will disappear in the next 20 years due to tech innovation.

UNIT 01
1.2. The 5Cs of 21st Century Skills

Computational Thinking

UNIT 01

1.3. How Should We Prepare for Computational Thinking?


"Computational Thinking is the thought processes involved
in formulating problems and their solutions so that the
solutions are represented in a form that can be effectively
carried out by an information-processing agent.“
- Cuny, Snyder, Wing, 2010

UNIT 01

2.1. Thinking like a Computer


※ To view the video clip above, move your mouse onto video screen to appear the play button.
3 ways to make better decisions -- by thinking like a computer | Tom Griffiths

UNIT 01

2.2. The 3 Structures of Programming


Sequence Selection Iteration

UNIT 01

3.1. Create a Program that Prints Your Resume

※ To view the
video clip above, move your mouse onto video screen to appear the play button.
UNIT 01

3.2. Program Planning


[1] # Self-introduction program

Start
Start [4] Print age

[2] Print preface of the resume [3] Print name [5] Print job

[6] Print the current address [7] Print birth place


[9] End Print job

Print resume prefacePrint name


Print current address Print birthplace

Print age
End

UNIT 01

3.3. Resume Program: Final Codes


UNIT 01

1.1. Definition and Importance of Sequence

Sequence is important in everyday life put toothpaste on How could the changed order affect the result?rinse toothbrush

toothbrush
put toothpaste on toothbrush

use toothbrush to clean teeth rinse toothbrush


use toothbrush to clean teeth

UNIT 01
2.1. Using the Glossary

UNIT 01

2.2. Expression, Statement, and Program


Expression Statement Program

352 timesleep(5)
10 + 20 ‘Hello World!’ assemble assemble
print(‘Hello World!’)
timesleep(5) import time
import print(‘Hello World!’)
17.2

UNIT 01

2.3. Annotation
#define the variable as a radius

#print the radius, area, and circumference of the circle


('Radius', radius)
('Area', 3.14 * radius * radius) Area 50.24
('Circumference', 2.0 * 3.14 * radius) Circumference 25.12
#Apply the formula to solve for the area of a circle #Apply the formula to
Radius 4.0 solve for the circumference of the circle

UNIT 01
2.3. Annotation

You can create a multiple-line annotations using double quotation marks.

It allows you to make multiple lines of comments.

It allows you to make multiple lines of comments.

It allows you to make multiple lines of comments.


UNIT 01

2.4. Reserved Word


Try to fully understand the basic concept before moving on to the next step.
Lack of understanding basic concepts will increase your burden in learning this course,
which may make you fail the course.
It may be difficult now, but for successful completion of this course we suggest you to fully
understand the concept and move on to the next step.

UNIT 01
Start
Move Right, Fill-In Square, Move Right, Move Down Fill-In
Here
Square, Move Left, Move Left, Fill-In Square Move Down, Move
Right, Fill-In Square, Move Right

Write the entire code and the expected output results in the note.

UNIT 01

Image 1

Image 2 Image 3 Image 4 Image 5 Image6

Move One Square Right Move One Square Left Move One
Square Up Move One Square Down Fill-In Square with Color

Write the entire code and the expected output results in the note.
UNIT 01

1.1. Installing Anaconda

UNIT 01
1.1. Installing Anaconda

UNIT 01
1.1. Installing Anaconda

UNIT 01

1.2. Installing Jupyter Notebook


UNIT 01

1.2. Installing Jupyter Notebook


UNIT 01

2.1. Definition and Necessity of Virtual Environment


python : 3.8
python : 3.7
Install pandas

data_science python_work

Computer

UNIT 01

2.2. Creating a Virtual Environment


UNIT 01
2.2. Creating a Virtual Environment

UNIT 01
2.3. Anaconda Commands for Managing the Virtual Environment

Execution
Command
See list of virtual environments conda env list

Create virtual environment conda create –n [name of a virtual environment]

Clone virtual environment conda create –clone [name of virtual environment to clone] –n [a new virtual environment]
Activate virtual environment conda activate [name of a virtual environment] Deactivate virtual environment conda deactivate

Remove virtual environment conda remove --name [name of a virtual environment] --all

UNIT 01
2.3. Anaconda Commands for Managing the Virtual Environment

UNIT 01

2.3. Anaconda Commands for Managing the Virtual Environment


UNIT 01
3.1. Running the Jupyter Notebook

UNIT 01

3.1. Running the Jupyter Notebook


UNIT 01

3.1. Running the Jupyter Notebook


UNIT 01

3.2. Jupyter Notebook UI


UNIT 01

3.2. Jupyter Notebook UI


UNIT 01
3.2. Jupyter Notebook UI

UNIT 01

3.2. Jupyter Notebook UI


UNIT 01

3.2. Jupyter Notebook UI


UNIT 01

3.2. Jupyter Notebook UI


UNIT 01

4.1. The Basics


Both single quote and
print( ) code is a command that outputs values inside the ( ) double quote marks work, but the start and end
symbol has to match.

The value between the open quotation and close quotation marks are called a string.
TIP

▪ Unlike other languages, Python automatically breaks a line after outputting a string through print().

UNIT 01

4.2. Printing String and Value


UNIT 01

4.3. Adding a New Line


UNIT 01

4.3. Adding a New Line


UNIT 01

4.4. The Comma(,) Additions(+), Multiplication(*) Operators


UNIT 01
4.4. The Comma(,) Additions(+), Multiplication(*) Operators

When using an addition (+) operator, you cannot combine strings and numbers. When a string and a number are combined with an
addition operator (+), TypeError occurs.

UNIT 01

4.4. The Comma(,) Additions(+), Multiplication(*) Operators


When a string and a string are combined with a multiplication operator (*), TypeError occurs.

UNIT 01

4.5. End and Split Parameters


UNIT 01

4.5. End and Split Parameters


UNIT 01

4.6. Creating a Resume


UNIT 01

5.1. Why is Pythonic Coding Important?


UNIT 01

5.2. Code lay out


UNIT 01

5.2. Code lay out


UNIT 01
5.3. Naming convention

Description

The first letter starts with a lowercase letter and uses _ (underscore) instead of spaces
between words. It’s called Snake Style because the underscores looks like snakes.

The first letter starts with a lowercase letter, and the start of the next word is
capitalized instead of spacing. It’s called the Camel style because the capital letters in
the middle looks like a camel's back.

Almost the same as the Camel style, but the first alphabet is also capitalized.

Style Example Snake hello_world

CamelhelloWorld Pascal HelloWorld

UNIT 01
5.3. Naming convention

1. Generally consists of English characters, numbers, and underscores (_).


2. There should be no spaces in the middle of the text.
3. The first word must start with an English letter or an under score (_).
4. Upper and lower case letters are distinguished. For example, Count and count are different identifiers. 5.
There is no limit to the length of the identifier.
6. Keywords cannot be used as identifiers.
7. Identifiers starting with __(two underscores) refer to special attributes or use only as the name of specific
methods. Therefore, it is not used as the name of a general function or variable.

UNIT 01
5.3. Naming convention

Correct Identifiers Reasons

number4 Numbers can be used after starting with English characters.

my_list Underscores can be used anywhere in the identifier, like the rest of the characters.
__code__ The name of a specific method can start with __(two underscores). for_loop A keyword can

be used by connecting with other characters.

UNIT 01

5.3. Naming convention


Incorrect Identifiers Reasons

1st_variable Cannot be used because it starts with a number.

my list Cannot be used because there is a space.

global Python keywords cannot be used as identifiers.

ver2.9 A special character other than the underscore cannot be used. num&co A special character

other than the underscore cannot be used.

UNIT 01

6.1. Syntax Error


UNIT 01

6.2. Runtime Error


UNIT 01

1. Runtime Error and Resolution


('Enter two integers.').split()

('Check if the integers are correctly entered.')

Enter two integers. 10 2


10/2 = 5.0

UNIT 01
1. Runtime Error and Resolution

('Enter two integers.').split()

('Check if the integers are correctly entered.')

Enter two integers. 10 two


Check if the integers are correctly entered.

('Enter two integers.').split()

('Check if the integers are correctly entered.')


Enter two integers. 10 0
Check if the integers are correctly entered.
UNIT 01

UNIT 01

You might also like