Telegram Group & Telegram Channel
Комплексные числа в Python

Кроме уже известных вам типов int, float и подобных, в Python существует еще один довольно интересный тип, а именно, complex.

В Python комплексные числа представлены в виде x + iy. Python преобразует реальные числа x и y в комплексное с помощью функции complex(x,y).

Это число можно превратить в строку с помощью str, посчитать его модуль с помощью abs, а также для доступа к его реальной или мнимой части можно воспользоваться функциями real() и imag().

Хотя данный тип и является встроенным, для полноценной работы с комплексными операциями понадобится модуль cmath.

Подписывайтесь на канал 👉@pythonofff



tg-me.com/pythonofff/2885
Create:
Last Update:

Комплексные числа в Python

Кроме уже известных вам типов int, float и подобных, в Python существует еще один довольно интересный тип, а именно, complex.

В Python комплексные числа представлены в виде x + iy. Python преобразует реальные числа x и y в комплексное с помощью функции complex(x,y).

Это число можно превратить в строку с помощью str, посчитать его модуль с помощью abs, а также для доступа к его реальной или мнимой части можно воспользоваться функциями real() и imag().

Хотя данный тип и является встроенным, для полноценной работы с комплексными операциями понадобится модуль cmath.

Подписывайтесь на канал 👉@pythonofff

BY Python академия




Share with your friend now:
tg-me.com/pythonofff/2885

View MORE
Open in Telegram


Python академия Telegram | DID YOU KNOW?

Date: |

Unlimited members in Telegram group now

Telegram has made it easier for its users to communicate, as it has introduced a feature that allows more than 200,000 users in a group chat. However, if the users in a group chat move past 200,000, it changes into "Broadcast Group", but the feature comes with a restriction. Groups with close to 200k members can be converted to a Broadcast Group that allows unlimited members. Only admins can post in Broadcast Groups, but everyone can read along and participate in group Voice Chats," Telegram added.

What is Secret Chats of Telegram

Secret Chats are one of the service’s additional security features; it allows messages to be sent with client-to-client encryption. This setup means that, unlike regular messages, these secret messages can only be accessed from the device’s that initiated and accepted the chat. Additionally, Telegram notes that secret chats leave no trace on the company’s services and offer a self-destruct timer.

Python академия from tr


Telegram Python академия
FROM USA