We had a new class with our beautiful lecturer, Dr.KB or her full name Dr. Khairul Bariyah. We were excited to learn new knowledge from her. Her style in teaching was quite interesting. She did not taught us directly but indirectly. HoHoHo. What's that meaning? Do you curious guys?
Let me tell you..
She divided us with seven groups and each group had their own questions.
The lists of the questions:
1) What is Python? What is the difference between Python and C
2) How to install Python
3) What are Python libraries?
4) What is Python Editor? Example: Jupyter notebook, IPython
5) What are the data types in Python (hint: lists)
6) How to print and display a word (Hello) in Python?
7) How to generate a plot in Python? Which library you should use?
All of us have our own questions and we need to find the all information regarding the questions. After we had our points, we need to discuss in group about our topic to be more detail about that.
Then, we need to form a new group which each person have their own question. We need to explain about our own question to the group mate. It looks like we teach them. We gained information and share to others will make us be more understand about that topic and remember it in a long time.
The advantage of this is we can ask questions to our friends without shy 😍😍.. Interesting, right?
The information about all the questions ^-^
1) What is Python? What is the difference between Python and C
- Python is an interpreted, object-oriented, high-level programming language with dynamic semantics. It is simple, easy to learn syntax emphasizes readability and therefore reduces the cost of program maintenance.
- The difference between Python and C
Python
|
C
|
Released in 1991
|
Released in 1972
|
Easier and short
|
Coding complex and long
|
Programing is slower
|
Programming more faster
|
Have library
|
No library
|
Less symbol
|
More symbol
|
Does not support 8-bit, 16-bit, 32-bit, 64-bit integers and word size. It supports arbitrarily precise bignum data types
|
Support 8-bit integer, 16-bit integer,32-bit integer, 64-bit integers and word size
|
Supports non-moving, mark-and-sweep garbage collection with automatic garbage collector
|
Does not include a garbage collector. Boehm Garbage collector can be used as garbage collector for C
|
2) How to install Python
We are using Miniconda to install because it is more complete.
- Type Miniconda
- Choose Python 3.6 (64-bit)
- Install
3) What are Python libraries?
**help you get started so that you don’t have to write code to reinvent the wheel.
- Numpy - It provides some advance math functionalities to python.
- SymPy can do algebraic evaluation, differentiation, expansion, complex numbers, etc.
- Scipy : high-level data processing routines. Optimization, regression, interpolation, etc http://www.scipy.org/
- Matplotlib : 2-D visualization, “publication-ready” plots http://matplotlib.org/
- Python Imaging Library
- PyGame – Python game engine
- SQLAlchemy – database toolkit for python
- wxPython. A gui toolkit for python.
4) What is Python Editor? Example: Jupyter notebook, IPython
5) What are the data types in Python (hint: lists)
Python has five standard data types −
6) How to print and display a word (Hello) in Python?
Type the code at Python :
7) How to generate a plot in Python? Which library you should use?
**use Matplotlib, http://matplotlib.org/
•IPython introduced a new tool named the Notebook. Inspired by scientific programs like Mathematica or Sage, the Notebook offers a modern and powerful web interface to Python.
•This interface can be used not only with Python but with dozens of other languages such as R and Julia.
Python has five standard data types −
- Numbers
- String
- List
- Tuple
- Dictionary
Python supports four different numerical types :
- int (signed integers)
- float (floating point real vialues)
- complex (complex numbers)
Python string:
•Subsets of strings can be taken using the slice operator ([ ] and [:] ) with indexes starting at 0 in the beginning of the string and working their way from -1 at the end.
•The plus (+) sign is the string concatenation operator and the asterisk (*) is the repetition operator. For example − see Example 6
Python lists:
- Lists are the most versatile of Python's compound data types. A list contains items separated by commas and enclosed within square brackets ([]).
- To some extent, lists are similar to arrays in C. One difference between them is that all the items belonging to a list can be of different data type.
- The values stored in a list can be accessed using the slice operator ([ ] and [:]) with indexes starting at 0 in the beginning of the list and working their way to end -1.
- The plus (+) sign is the list concatenation operator, and the asterisk (*) is the repetition operator. For example − see Example 8
Python tuples:
- A tuple is another sequence data type that is similar to the list. A tuple consists of a number of values separated by commas. Unlike lists, however, tuples are enclosed within parentheses and cannot be updated (read-only list)
Python dictionaries:
- Python's dictionaries are kind of hash table type. A dictionary key can be almost any Python type, but are usually numbers or strings. Values, on the other hand, can be any arbitrary Python object.
- Dictionaries are enclosed by curly braces ({ }) and values can be assigned and accessed using square braces ([]).
Type the code at Python :
- print ("hello")
- hello
7) How to generate a plot in Python? Which library you should use?
**use Matplotlib, http://matplotlib.org/
- There are many type of plotting in the matplotlib
- Choose the plot that we want.
- Copy the code and paste at Jupyter(Python 2/ Python 3)
- Edit the data that we want.
That's all that we had learnt last class. Hope you guys can get the knowledge..
Till we meet in the next post!!💓
No comments:
Post a Comment