Python Introduction Attila CEFFER: [email protected] Agil YOLCHUYEV: [email protected] Budapest University of Technology and Economics Overview
Background IDE/Editors Types Operators/ Loops/Control Flow Functions Libraries
What is Python? Python is high level programming language. Python can be used to develop desktop GUI applications, websites and web applications, scientific applications. Why Python? Python is compatible with numerous platforms, so a developer doesn't
have to bother about any issues which often occurs with other languages. Python supports procedure-oriented as well as object-oriented programming. Python has huge pile of various libraries, such as NumPy, SciPy, BeautifulSoup, SQLAlchemy, Matplotlib and so on Python is a dynamically-typed language. You can announce variable
wherever you want and which type you want Python meets Less Code, Less Time principle. Hello World C# C++
Python IDE/Editors VIM Default Editor can be used in linux Nano Another Command line linux editor Pycham- Professional Python IDE: Professional and Community Editon
Jupyter Web Based application for creating live based python code Jupyter Notebook Download and Install Python: Mac: brew install python
Windows: Tradiotional next -> next -> next Install Jupyter:
For python3: python3 -m pip install --upgrade pip python3 -m pip install jupyter
To start Jupyter: jupyter notebook
To install packages: pip install package_name conda install package_name Installing packages in Python
Check Library package was installed: Alternatively: Run Jupyter Online https://colab.research.google.com/notebooks/welcome.ipynb
Jupyter Interface Python Types Type Name Character
Example Number Maximum size 2^63 - 1 my_number = 1
List Mutable type max size 4294967295 ex_1 = [] ex_2 = [1,2,3]
String Immutable Type no maximum limit ex_1 = hello world
Dictionary Mutable Key value principles, key should be immutable tt = { name:Agil, age: [1,2,3,4] }
Set Unique values my_set = {1, 2, 3}
Tuple Immutable list my_tuple = (1,2,3,4) Bool
Logical operations My_bool=True Basic Types and Operations
Number: Python String Basics: https://www.programiz.com/python-programming/string String:
Basic Types and Operations List1: List2: Python list basics:
https://www.programiz.com/python-programming/list Basic Types and Operations Basic Types and Operations
Dictionary 1: Python list basics: https://www.programiz.com/python-programming/dictionary Dictionary 2:
Basic Types and Operations Set Python list basics: https://www.programiz.com/python-programming/set
Operations Python Loops and Flow Control Python Loops and Flow Control Python If, IF-ELSE-IF
Statement Python single line operations Python Comments and Sensitivity
Python Functions Python Built-in Functions Python Built-in
Functions Python Built-in Functions File Operations
Python Modules and Libraries There are lots of standard and a new developed packages by python community. Search some built-in packages: https://docs.python.org/3/library/ Example For Most Used Python libraries in science: Numpy
Scipy Matplotlib Pandas NumPy NumPy Example
NumPy Example NumPy Example Matplotlib
Pandas Basic Testing Task Write a program to compute the multiplication of two given matrixes. Input Data: p = [[1, 0], [0, 1]] , q = [[1, 2], [3, 4]]
Write a program to compute the eigenvalues and right eigenvectors of a given square matrix Input Data: [[3 , -2],[1, 0]] Useful links 1. Learn Basics of the Python:
https://www.learnpython.org/ 2. Learn Numpy: https://realpython.com/how-to-use-numpy-arange/ 3. Some Examples about numpy: https://www.w3resource.com/python-exercises/numpy/ 4. Learn Matplotlib: https://realpython.com/python-matplotlib-guide/