You are on page 1of 21

Intro to Python

Week 1 – Basic Concepts


Overview
• What is Python
• Syntax
• Tools
• Unix/Linux
• With Windows
• Tools
• Python and Cyber Security
What is Python
Python is an interpreted high-level programming language for general-
purpose programming.
• Multi-purpose(Web, GUI, Scripting etc.)
• Interpreted
• Object Oriented
• Focus on productivity
About This Class
• Learning basic syntax
• Writing pseudocode based on code
• Writing code based on pseudocode
Who Uses Python

• Google
• PBS
• NASA
• Library of Congress
• The ONION

Let’s Explore

• https://realpython.com/world-class-companies-using-python/
Which is the best programming to
What skills you need for Cyber Security
History of Python

• Created in 1989 by Guido Van Rossum


• Python 1.0 released in 1994
• Python 2.0 released in 2000
• Python 3.0 released in 2008
• Python 2.7 is the recommended version
• Python 3.11
Use of Python
• Games
• 3D Printing
• GPS
• Security System
Python and Cyber Security
Python’s simple and clean structure, modular design, and
extensive library make it ideal for security applications. Cyber
experts rely on the capability to rapidly code programs and the
feature set to implement new strategies and techniques. No
other language offers as powerful a combination, and Python
stands as the must-know language for the serious security
professional.

https://www.quora.com/How-is-Python-used-in-cyber-security
Example of Python in Security
Syntax
• Using Keyword “print” to display contents
• Using “import” to get the package into your program
• Using command line to execute a file
Framework of Python
• Pycharm
• Pyform
• Django
• Pylon
• CheyryPy

Note: there are more framework for variety


System Developments
Python IDLEs
Python IDLEs - 2
Select File > New from Python IDLEs, then you get the
following screen
Keyboard Input
• Using function: input() – version 3
• Using function raw_input() – version 2

Example:

name = input("Enter a name: ")


print("Your name is " + name )

Note:
The “name” here is a variable that we are going to explain next week.
Pseudocode
A Pseudocode is a high-level description of
computer program or program algorithm.
It is close to human language so it is used for
human reading (not machine reading)
Example of Pseudocode
Python code: Pseudocode:

name = input("Enter a name: ") Start Terminal


print("Your name is " + name )
Input name

Process

Output Message

Stop Terminal
Symbols
1) + sign is a connection symbol to connect multiple Strings(text)

Example:
print ("Hello " + "Bing")

2) , sign is also a connection symbol to connect multiple part of python code with
numeric values

Example 1:
a = 50
print ("The memory value in a is " , a)

Example 2:
name = input("Enter a name: ")
print("Your name is " + name )
Comments in Python
# sign is used to disable the single line of code or put comments
for your code
''' sign is used to disable the multiple lines of code or put
comments for your code
Reference
https://www.tutorialspoint.com/python/python
_strings.htm

You might also like