Python is simple, general purpose, high-level and object-oriented language, developed by Guido van Rossum.
- Easy to learn.
- Object oriented programming.
- Integrated
- Has dynamic memory allocation.
- Extensible
- Inteprated language.
- GUI Programming.
- Embeddale: It can be implemented in other languages i.e
C
andC++
.
- Web development: There are several frameworks such as django, flask, Pyramid, CherryPy That supports server side web development.
- Data Science: Python is widely used in data science using pandas, tableu, matplotlib for data science and visualization.
- Machine Learning: Tensorflow, pyTorch Scikit-learn, matplotlib, Scipy etc. helps to implement machine leaning.
- Mathematics: Using Numpy, Pandas are usefull in mathematics operations.
- Data mining
- Console applications.
- Mobile applications.
- Speech recognition.
- Software development.
- Enterprice aplication.
- Computer vision and image processing.
- 3D CAD applications.
Python is mostly initially installed in most operationg systems:
python3 --version
to check if its installed.
To install python on linux system type:
sudo apt-get update
sudo apt-get python3
Shebang line: Add
#!/usr/bin/python3
on your first python file
#!usr/bin/python/python3
print("Hello world")
Thats all you need to install python and type your first code in python.
#!/usr/bin/python3
x = 10
print(x) # This is a comment
Identifiers are user-defined keywords
- Class names start with capital letters all other identifiers start with lowercase.
- Identifier starting with single underscore indictes its private.
- Two starting underscore indicates its strongly private.
- Ending with two underscore its a special language defined name.
#This is a single line comment
'''
This is a multiline comment
'''
We use line character to for multi lines
print("When starting to program i found it difficult but concistency \
and never giving up keeps me going on on this journey")
word = 'Hello'
sentence = " Hello world"
paragraph = '''Hello world \
This is a multiline comment
'''
A bug is an error in a code that This is a process of identifying a problem isolating and solving or findia a way through it.
- syntax error:
This is an error that occurs as a result of violating structure of a program i.e:
print hello world
- logical error:
Also called semantic error
This ia an error that occurs as a result of a mistake from logical operations of a programmer. An error in a program that makes it do something other than what the programmer intended. - Runtime error:
This is an error that occurs after running as a program also called exceptions as they are as a result of something bad has appened
Other topics are covered within the documented part of each folder with practices and projects descriptions.
This document was wtitten and documented by Titus Kiplagat