Arithmetic in Python V3 || Python Tutorial || Learn Python Programming

preview_player
Показать описание

And beware of division by 0!

To learn Python, start our Python Playlist HERE:

♦♦♦♦♦♦♦♦♦♦

We recommend:
Python Cookbook, Third edition from O’Reilly

The Mythical Man Month - Essays on Software Engineering & Project Management

Shop Amazon Used Textbooks - Save up to 90%

♦♦♦♦♦♦♦♦♦♦

Ways to support our channel:

► We also accept Bitcoin @ 1EttYyGwJmpy9bLY2UcmEqMJuBfaZ1HdG9

Thank you!

♦♦♦♦♦♦♦♦♦♦

Connect with us!

♦♦♦♦♦♦♦♦♦♦

Python instructor: Ulka Simone Mohanty
Written & Produced by Michael Harrison
FX by Andriy Kostyuk

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

It's official! The Socratica Python Kickstarter was a success! Thank you to all of our supporters. Because of you, many more Python videos coming soon!! 💜🦉

Socratica
Автор

*Arithmetic in Python V3*

Hello, hello! Our latest Python tutorial is on arithmetic in Python V3.  The main difference between V2 and V3 is that whole number division in V3 returns the correct value as a float, while in V2 it returns the quotient.

More videos are coming soon!

#LearnMore

Socratica
Автор

I'm impressed how clear you made this topic.

zzRider
Автор

At 1:10 it is stated that the float is rounded then made into an int. This is incorrect, the float is truncated then made into an int, as such using int() to convert 3.2 or 3.8 will return 3 and -3.2 or -3.8 will return -3. Which is consistent with normal integer arithmetic.
To round and convert you must use round()[yields 3, 4, -3, - 4],
for more control import "math" and use math.ceil()[yields 4, 4, -3, -3] or math.floor() [yields 3, 3, -4, -4]
Also to get [4, 4, -4, -4] using the above inputs: int(math.copysign(math.ceil(abs(g)), g))

TheDuckofDoom.
Автор

This makes me want to watch Stargate..
great videos

davidjamriska
Автор

Awesome videos! You can add exponent operator **, for example: 4**2 = 16

fernandosuyama
Автор

that`s very clear explanation, thanks for that. But to add some tiny correction in 1:12 " yo said the number first rounded then made it to an int. and as the round() is a function which convert the float number to the Nearest whole number and different from int() casting function, its better to say Not first rounded. thank you

Etronic
Автор

Appreciate the effort you guys put in :)

GM-xzxc
Автор

Your python tutorials are awesome !!!

It will be better if you will share the slides for this playlist ....Please ...

Thanks in advance

kiranshah
Автор

good presentation easy and simple to understand .

MrPurush
Автор

The int() constructor doesn't round, but truncates

AlexMaday
Автор

i love you, you oped to me new world thanxxx

AhmedAhmed-nfzg
Автор

Why do we have to make a integer “wider” in order for the integer to operate with a float?

jackyoung
Автор

I don't understand why this channel has few viewers. It seems people don't want to learn programming.

captainfuture
Автор

MY question is why we cant convert complex numbers into floats ? like DUh just add -0j in the complex number you will get the float back simple logic. pls reply

Bhavishtraders
Автор

then you making int of a float it`s NOT rounded it`s rounded DOWN or decimal part is Discarded

deniszest
Автор

sheesh i just started learning python and im already terrified

pastorofmuppets
Автор

Another "interesting" difference between python 2 and 3:
python3: (2+2j)//2 -> TypeError: can't take floor of complex number.
python2: (2+2j)//2 -> (1+0j) # seems like they only truncated the real part

ulilulable
Автор

when int is used with a float number, the fractional part gets removed, THEY ARE NOT ROUNDED OFF, AS MENTIONED IN THE VIDEO...

krish
Автор

Im using windows when following this tutorial. And I dont get the Ellipsis after a # comment line Anyone know why?

orangerazzz