Python Tutorial for Beginners 3: Integers and Floats - Working with Numeric Data

preview_player
Показать описание
In this Python Beginner Tutorial, we will begin learning about integers and floats. Integers and Floats allow us to work with numeric data in Python. We will be learning how to perform basic arithmetic, as well as how to compare numeric values. Let's get started.

The code from this video can be found at:

Watch the full Python Beginner Series here:

✅ Support My Channel Through Patreon:

✅ Become a Channel Member:

✅ One-Time Contribution Through PayPal:

✅ Cryptocurrency Donations:
Bitcoin Wallet - 3MPH8oY2EAgbLVy7RBMinwcBntggi7qeG3
Ethereum Wallet - 0x151649418616068fB46C3598083817101d3bCD33
Litecoin Wallet - MPvEBY5fxGkmPQgocfJbxP6EmTo5UUXMot

✅ Corey's Public Amazon Wishlist

✅ Equipment I Use and Books I Recommend:

▶️ You Can Find Me On:

#Python
Рекомендации по теме
Комментарии
Автор

I cannot understand how could anyone dislike this video series. Simply the greatest on Youtube

benzeltser
Автор

This is the first time that I finish a tutorial without paying attention to how much time is left! Love you Corey.

mahshidpooladvand
Автор

I'm just looking for a python refresher when I found this gem of a channel. I can't believe these were made 6 years ago and is still more informative than newer one I've found so far. Subscribed!

Private-lwtd
Автор

Great videos. I'm three videos in and this is exactly what I was looking for. Straight to the point, easy to understand, logical progressions, and very easy to follow along. Couldn't ask for more.

swpingbird
Автор

Hey Corey, You are my Python Guru. I like your style of teaching. It is quiet effective.

sudarsandm
Автор

Really liking your vids Corey. I like them a lot better than the on-line classes I bought. Thanks for sharing your knowledge.

dibtqui
Автор

Some notes:


Numbers


Types :-
- int, normal integers like, -2, 3, 0 etc
- float, decimal/fractional values like, -0.4, 9.83 etc.

Arithmetic Operators :-
- 3 + 2 # Addition
- 3 - 2 # Subtraction
- 3 * 2 # Multiplication
- 3 / 2 # Division
- 3 // 2 # Floor Division (rounds float to int)
- 3 ** 2 # Exponent
- 3 % 2 # Modulus (remainder)

Comparisons :-
- return either true or false
- 3 == 2 # Equal
- 3 != 2 # Not Equal
- 3 > 2 # Greater Than
- 3 < 2 # Less Than
- 3 >= 2 # Greater or Equal
- 3 <= 2 # Less or Equal

Incrementing :-
num = 1
num += 1 # same as num = num + 1
# the "+" in += can be replaced by any other arthimetic Operators
# eg num *= 2, now num = num * 2 = 2. Similarly all other arthimetics.

Useful functions :-
1. Absolute value function - abs(value)
- gives the magnitude of integers.
- basically, removes the negative sign if there is one.
- abs(-3) # returns 3
2. round function - round(value) .
- Also accepts another argument to specify no. of digits
- after the decimal point to round the value off to.
- round(3.75) # returns 4
- round(3.75, 1) # returns 3.8, ie. 1 digit

Type conversion/casting :-
- int(value)
- num = "1"
int(num) # returns 1 as an integer

Miscellaneous :-
- Add parentheses () for enforcing precedence.
eg: 3 * (2+1) = 9
- you can use type(variable_or_value) to find the value's data type.

immortalized_onion
Автор

Thank you for these videos, Corey! As someone primarily using genomics in grad school this is extremely helpful to get my feet into the python door.

clarkh
Автор

Wow... Thanks Corey, you are golden as always. You make learning not only crystal clear but also enjoyable. Ive gave up on learning coding 2 years ago after burning out, but im back on track, stronger and more persistent then ever! Cant wait to revisit all the concepts.

hiseggcelency
Автор

I have watched countless python tutorials this one is the best I've ever seen. Great Job Man!

gokulrajkumarassamy
Автор

One the best Python tutorial I have seen! Very Effective

melvin
Автор

Corey Schafer's Python educational videos are by far the best I have come accross. I have been learning, and now teaching python coding, for several years but Corey's teachings have been invaluable. I should really recommend my own video's but for all levels of Python Corey Schafer is THE first place I'd suggest for everyone. Thanks to Corey @coreyschafer for the excellent work.

stuthomas
Автор

I am really enjoying the sequential presentation of concepts in these tutorials. Not sure why this isn't the established curriculum for other popular courses available online. I have been so frustrated lately, having to migrate from course to course to fill in the gaps. It is understandable that no two courses are alike and that many have the stated objective of rapidly immersing the student in pragmatic exercises that are teachable, but from a strictly pedagogical standpoint, Corey appears to have struck gold here.

seanearnest
Автор

Corey - what a fantastic video series. An easy to follow tone of voice, the right information, the right depth, the right speed of delivery. Thank you so much!!

Glenn.Cooper
Автор

Hi Corey, great content. I'm learning a lot from your tutorials. Just started today. Keep them coming! Thank you!

muddaarmy
Автор

wow thanks! I'm trying to learn Python and this by far is the best tutorial I've seen yet :)

eli.
Автор

Hey,
just wanted to say thank you! I'm trying to learn python during this crazy time and between you and my uncle (who is a coder) I'm slowly figuring this out.
God Bless and Stay Safe!

jameselliott
Автор

I studies python basics with three courses but i found myself missed alot . You are the best python teacher on the planet

khaled-dz
Автор

thank you Corey for this beginner series, I've been struggling for a long time on these basic concepts and saw a lot of videos but your videos are the best!

domss
Автор

Interesting Fact: Pacman's famous kill screen was due to an integer overflow.

benderbendingrofriguez