0% found this document useful (0 votes)
134 views25 pages

CS001L M2 Introduction To Python

This document provides an introduction to Python programming for a module being taught in the first term of 2021-2022. The learning objectives are to introduce students to the Python programming language and its integrated development environment. A brief history of Python is provided, noting it was started in 1989 and was influenced by other languages like ABC and Modula-3. Tips for learning Python include discussing concepts, writing small projects, and exploring libraries and frameworks. Key features of Python like being easy to use, having a large standard library, and being open source are listed. Example frameworks and libraries for tasks like web development, GUI development, and machine learning are provided. The document concludes with an example of a basic "Hello World" Python program.

Uploaded by

Jun
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)
134 views25 pages

CS001L M2 Introduction To Python

This document provides an introduction to Python programming for a module being taught in the first term of 2021-2022. The learning objectives are to introduce students to the Python programming language and its integrated development environment. A brief history of Python is provided, noting it was started in 1989 and was influenced by other languages like ABC and Modula-3. Tips for learning Python include discussing concepts, writing small projects, and exploring libraries and frameworks. Key features of Python like being easy to use, having a large standard library, and being open source are listed. Example frameworks and libraries for tasks like web development, GUI development, and machine learning are provided. The document concludes with an example of a basic "Hello World" Python program.

Uploaded by

Jun
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/ 25

Introduction to Python

CS001L.Module 2
First Term 2021 -2022
Learning For this module, learners will be
Objective introduced to the python
programming language and its
IDE.
Implement the basic structure and
essential elements of a particular
Python code.
PYTHON Python laid its foundation in the
late 1980s. The implementation of
HISTORY Python was started in December
1989 by Guido Van Rossum at
Centrum Wiskunde &
Informatica ( CWI ) is the
national research institute for
mathematics and computer science
in the Netherlands.
In February 1991, Guido Van Rossum
PYTHON published the code (labeled version 0.9.0) to
HISTORY alt.sources. However, Guido Van Rossum
was reading the script of a popular BBC
comedy series "Monty Python's Flying
Circus". It was late on-air 1970s. Van
Rossum wanted to select a name which
unique, sort, and little-bit mysterious. So he
decided to select naming Python after the
"Monty Python's Flying Circus" for their
newly created programming language.
PYTHON ABC programming language is said
HISTORY to be the predecessor of Python
language, which was capable of
Exception Handling and interfacing
with the Amoeba Operating System.
Moreover, Modula-3 is the other
programming languages influence
Python.
Tips to Keep in Mind While Learning
Python
• Discuss Concepts with
• Make it Clear Why We Want Other
to Learn
• Do small Projects
• Learn the Basic Syntax
• Teach Others
• Write Code by Own
• Explore Libraries and
• Keep Practicing Frameworks
• Make Notes as Needed • Contribute to Open Source
Features of Python Features of Python

Easy to Learn and Use Extensible

Expressive Language Large Standard Library

Interpreted Language GUI Programming Support

Cross-platform Language Integrated

Free and Open Source Embeddable

Object-Oriented Language Dynamic Memory Allocation


Frameworks in Web Applications
• Django and Pyramid framework(Use for heavy applications)
• Flask and Bottle (Micro-framework)
• Plone and Django CMS (Advance Content management)

GUI library to develop a user interface.


• Tkinter or Tk
• wxWidgetM
• Kivy (used for writing multitouch applications )
• PyQt or Pyside

Frameworks of machine libraries are given below.


• SciPy
• Scikit-learn
• NumPy
• Pandas
• Matplotlib

Python creates a 3D CAD application by using the following functionalities:


• Fandango (Popular ) Libraries of image processing are given below.
• CAMVOX • OpenCV
• HeeksCNC • Pillow
• AnyCAD • SimpleITK
• RCAM
First PYTHON Program
BASIC SYNTAX
Python provides us the two ways to run a program:
Interactive Interpreter Prompt Script File(Script Mode Programming)
Basic Syntax 1.def func():  
2.       statement 1  
There is no use of curly braces
or semicolon in Python
programming language. It is 3.       statement 2  
English-like language. But
Python uses the indentation to 4.       …………………  
define a block of code.
Indentation is nothing but 5.       …………………  
adding whitespace before the
statement when it is needed. 6.         statement N  
FIRST PYTHON PROGRAM
JAVA PROGRAM PYTHON PROGRAM

1. public class HelloWorld {  
2. public static void main(String[] args){  
3.// Prints "Hello, World" to the terminal
print("Hello World") 
 window.    
4.  System.out.println("Hello World");  
5. }  
6. }  
Python The print() function displays the
print( ) given object to the standard output
device (screen) or to the text stream
Function file.

Python print() function is most unique


and versatile function.
Python Syntax : print( ) function
print( ) print(*objects, sep=' ', end='\n', file=sys.stdout, flush=False) 
Function Wherein:
objects - An object is nothing but a statement that to be printed. The * sign
represents that there can be multiple statements.
sep - The sep parameter separates the print values. Default values is ' '.
end - The end is printed at last in the statement.
file - It must be an object with a write(string) method.
flush - The stream or file is forcibly flushed if it is true. By default, its
value is false. 
Example : print( ) Function
Example -1 Example - 2: Using sep and end argument
print("Welcome to Python.")   a = 10  
a = 10   print("a =", a, sep='dddd', end='\n\n\n')  
# Two objects are passed in print() functio print("a =", a, sep='0', end='$$$$$')  
n  
print("a =", a)  
  
b = a  
# Three objects are passed in print functio
n  
print('a =', a, '= b')  
Python Python provides the input() function which is
input( ) used to take input from the user.
Function Syntax : input()

Example :
name = input("Enter a name of student:")  
print("The student name is: ", name)  
Laboratory Activity1.2
ASCII ART and Student Information
PROCEDURE
Graphic Paper and ASCII Art
Laboratory Activity 1
Procedure
• Step 1. Select your preferred ASCII Art.
• Step 2. You may visit this suggested URL Links.
• https://text-symbols.com/ascii-art/
• www.asciiart.eu
• Step 3. Kindly open, MS Excel Application for graphic paper format.
• Set the Column width as 1 to 2 inch.
• Please see the given example attached in this activity.
• Step 4. After you created your graphic paper using MS Excel, you may now copy and
paste your preferred ACSII Art.
• Step 5. Save your Excel file as Section.LastName1.LastName2.LabA1
• Example: Example: A50.DelosSantos.Arupo.LabA1
• PLEASE BE GUIDED.
PROCEDURE
ASCII Art and First
PYTHON Program
Laboratory Activity 1
Procedure
• Step 1. Be ready and open your ACSII Art Excel File.
• Step 2. Open the MS Word Application and the Laboratory Exercises
Template.
• Step 3. No ambiguity.
• Step 4. This is your First PYTHON Program, using print() & input()
• Step 5. Save your Word file as
Section.LastName1.LastName2.LabA1
• Example: A50.DelosSantos.Arupo.LabA1
• PLEASE BE GUIDED.
Laboratory Problem: Write a Python program that will ask for the following
Activity 2 data: name, age, program and school. And also show the
algorithm of the data. Finally, Save as your file in MS Word as
Section.LN1.LN2.LabA2
Sample Run:
Enter your name: Rhea
Enter your age: 18
Your Program: BSIT
School: Malayan Colleges Laguna
Hi, Rhea. You are 18 years old. BSIT student of Malayan
Colleges Laguna
Point System
• Activity 1 and 2 • Activity 1 or 2
• Grade score =100 to • Grade score = 89 to 85
90 • NO ACTIVITY =
• NO ACTIVITY = ZERO
ZERO
Merci!
Any questions?
You may send your question in MS Teams
[email protected]

25

You might also like