Learn Python like a Professional! Take You from 0 to Hero
In this Python lecture, we will learn about the Numbers.
Type of Numbers
There are three numeric types in Python
- Integer
- float
- Complex
we focus on the Integer & floating point number.
1. Addition
Basic Arithmetic
1. Addition
1 + 2
2 + 3
2. Subtraction
2 - 1
3 - 2
3. Multiplication
1 * 2
2 * 3
4. Division
2 / 5
5 / 7
5. Power
2 ** 3
3 ** 4
6. Order of Operation
1 + 2 * 3
(1+2)*(3+4)
7. Assign Value
x=2
y=3
x
y
z=x+y
z
8. Rules for Python Variable Name
- Must begin with a letter (a - z, A - B) or underscore (_)
- Other characters can be letters, numbers or _
- Case Sensitive
- Can be any (reasonable) length
- There are some reserved words which you cannot use as a variable name because Python uses them for other things.
principal=10
interest_rate=2
time=3
simple_interest=principal * interest_rate * time / 100
simple_interest
What is the importance of this lecture?
- + is the sign of addition.
- - is the sign of Subtraction.
- * is the sign of Multiplication.
- / is the sign of Division.
- ** is the sign of Power.
- Shift + Enter is used to run the code in jupyter notebook.
- TAB is used to Autocomplete in jupyter notebook.
EDITS ARE WELCOMED!!
In the next Blog, we will discuss Python String
https://sngurukuls247.blogspot.com/2018/09/python-ninja-bootcamp-5-strings.html
......................................................................................................................................
Instagram-
https://www.instagram.com/python.india/
View the Jupyter Notebook for this lecture
Download the Jupyter Notebook for this lecture
https://sngurukuls247.blogspot.com/2018/09/python-ninja-bootcamp-5-strings.html
......................................................................................................................................
Follow the link below to access Free Python Lectures-
https://www.youtube.com/channel/UCENc9qI7_r8KMf6-_1R1xnwInstagram-
https://www.instagram.com/python.india/
View the Jupyter Notebook for this lecture
Feel free contact me on-
Email - sn.gurukul24.7uk@gmail.com
No comments:
Post a Comment