����� > �������� > ����� ���������

����� ��������� 

����� ��� ����� ��� �� �������:

>>> type ("Hi There")
<type 'string'>

�������� �� �� ��, ���� ����� �� ��� ������. ����. �� ������, ����� �������� �� ��������, ���� ����� ���� ��������. (�������� ���� ����� ���� �������� ���. ����� ���, ������ �� ���������� ��� ��� �� ���� �������� ����� �� ��������, ���� ������� �������). ���� ���� �������� "�����" ������� �"������" ���.

����� �������� ���� ��� �������� ������ �� ��� ������ ������ ����. ���� ������� ��������� ������� ����� ���, ����� ������ ��������.

>>> int ("32")
32

>>> int ("avi")

Traceback (most recent call last):

 
File "<stdin>", line 1, in ?

ValueError: invalid literal for int(): avi

>>> int (3.2)

3

>>> float(44)

44.0

>>> float("9.99")

9.990000000000000

>>> str(44)

'44'

��� ��� ������ �� ����� �� ����� ����� �����, �� ����� �� ������ �����, �"� ���� ��� ������ ����� ������:

>>> minute = 59
>>> float(minute) / 60.0

0.983333333333

��� ���� ��� ������ ����� ��������� ������� �������. �� ��� ��������� ������ ������ ��� ���� ������, ������� ���� ���� �������� ����� ������ �� ��.

>>> minute = 59
>>> minute / 60.0

0.983333333333

������ ����� ������ �� �������� ������� ����, ������ �����, ������� ������. ����� ������� �� �������� ��� ���� ���� ������� ������� ������. ��������� �������� ������� ������� ������ ������. ����� ����� ���� �� ������� ���� �������� ��� �� �����, �� ��� ������ ��������� �������� ���� ������ ������, �� ����� �� ������:

>>> import math

��� ����� ��������, �� ����� �� �� ������ �����-��� �� �� �������� ����. ���������� �� �������� ������� �������� �������.

>>> decibel = math.log10 (17.0)
>>> angle = 1.5

>>> height = math.sin(angle)

����� ������� ������ ����� ������ "�����" �� ���� ��������� ����� 10 �� 17. ����� �� ������� ������ ��� log ������ ������� ����� �����.

����� ������� ������ ����� �� �������� ������ �� ���� ����� ������ angle. �������� ������ ���� ��������� �������������� (�������, ����� ���') ������ ��������� ������� �������. (��� ����� ��� ������ ��������, �� ����� � 360 �������� � 2*pi). ���� ����� ������ �������� ����� ���� 45 �����:

>>> degrees = 45
>>> angle = degrees * 2 * math.pi / 360.0

>>> math.sin(angle)

��� ��������, �� ���� ������ ���� ������ ��������, ��-��� ����� ������� �������. ���� ������ ������ ������� (����� �� ����� ����� ��������) ���� ������� ��������

>>> x = math.cos(angle + pi/2)

��� ����� �������� �������� ������� ���� �� �����, ���� ����� �� ��� ������ angle ������ pi. ������ x ���� �� ��� �������� ������� �� ������.

��� �����, ���� �� ������ �������� (����� ���� � ���� ������ ��������) ���� ������ ������ �������� �������� ����. ������ ����� ����� ������� ����� ����� �� ����� 10, ����� ��� ����� ��� e ����� ������. ���� ������ ���� ������ x.

>>> x = math.exp(math.log(10.0))

 
���� ����
�����
�����
�����
�����
��������
����� ������
������ ������
����� ������ - �����
����� ����� �����
�������
����
���� �������
������� ����