Python ��� For Statement ��� ������ �����������.
������ ¶
���간..������������..
결과��� ��������������.������ �����..��������� ��������� ������겠������...���감...;;;;
������ 1 ¶
������게 ����� ��������� ��������� ��������� ������겠���고 ������.
��������� hello world������ ��������� a ������ C++��� ������과 ���������게 ��� ��� ���기 ������������. h���
a[0]
, e ��� a[1]
... ��������������� ���������. ��������� ������ ��������� 값��� ����� ������ ��������� ������ C++��� ���������고 ������ ���������.
��������� ����� ��������� C++��� ��������������� C++��� string ���������, Java��� String ������������ ��������������� ������ ��� ��� ������. -- Leonardong
������ 2 ¶
python��� for statement ��������� 근��������� ������������ ���근��� ���������.
python��� ������������.
~cpp for i in 'helloworld':print i, for i in [ 'h','e','l','l','o','w','o','r','l','d']:print i,������과 ����� ��������� ��� ������������ �������� ������ ���까���?
������ for ������ ��������� ������ ���������.
������������ ��������� ������과 �����������.
{{|
Sequences
These represent finite ordered sets indexed by non-negative numbers. The built-in function len() returns the number of items of a sequence. When the length of a sequence is n, the index set contains the numbers 0, 1, ..., n-1. Item i of sequence a is selected by ai.
...
~cpp for statement definition for_stmt ::= "for" target_list "in" expression_list ":" suite ["else" ":" suite] --- ���������게 ���������������, for ���겟객������������(target) in ������������(expression_list==sequence): ���(expression)in ��������� ��������� ������ ������������ ���������.
������������ ��������� ������과 �����������.
{{|
Sequences
These represent finite ordered sets indexed by non-negative numbers. The built-in function len() returns the number of items of a sequence. When the length of a sequence is n, the index set contains the numbers 0, 1, ..., n-1. Item i of sequence a is selected by ai.
...
��������� ������ .png)
.png)
���������
�������� ������������ ������������ ��������� �������� ���겨��� ������. ��������������� len()��� ������������ ��������� 갯������ ������������. ������������ 길������ n������, ������������ 0..n-1 까������ ��������� ��������. ������������ ��������� i��� ai��� ������������.
�������� ������������ ������������ ��������� �������� ���겨��� ������. ��������������� len()��� ������������ ��������� 갯������ ������������. ������������ 길������ n������, ������������ 0..n-1 까������ ��������� ��������. ������������ ��������� i��� ai��� ������������.
... ������������ ������ ������...������
|}}
������������ ������������ 2.3 기��������� ������������� ������ ������ ������ ������������.
{{|There are six sequence types: strings, Unicode strings, lists, tuples, buffers, and xrange objects|}}
������������ strings ��� ��������� ���������,
|}}
������������ ������������ 2.3 기��������� ������������� ������ ������ ������ ������������.
{{|There are six sequence types: strings, Unicode strings, lists, tuples, buffers, and xrange objects|}}
������������ strings ��� ��������� ���������,
a[i]
��������� ���근������ ������������. ���������, for i in 'helloworld': print i,
������ i��� ��������������� 'h','e'... ��� ������������
������ 기������������ list��� ������ ��������� ���������,
a[i]
��������� ���근������ ������������.for i in [ 'h','e','l','l','o','w','o','r','l','d']:print i,��� ������ i�� 'h','e'.. ��� ���������게 ���������.
���기까��� ������ ������������, Python Language Reference������ sequence, for statement��� ��������� ������ ��������� ���������. ����������� ��������������� ��� ������������������. 그���고 ��������� ������기������ ������ ��������� ��� ��������� ����������� 겁������.
C / Java 1.4 ������������ ��� for ������������ 객������ ��������� ������ ������������ ������������. ��� ��������������� for������ ��������� ����������� ��������������, ���������������. ���, while������ ��������� ���기 ���게 ���간 고������������ ������������ ��������� ���과���������.
C/Java1.4������ ��� Python��� for������ ������ ��������� ������ ������������. 그���고 ���������������. C��� for���과 구������기 ��������� python��� ��������� for������ ������ for each ���������고 ������������. ���게 ������ for��� ������고 ������기��� ���������.
��� C++��� ���������������, C++��� ������������ C��������� ������������ ���고, C��������� ������과 ����� ��������� ������ ������������ ���근������ ��������� ������ ������������ ������ �������� ��������� 구������ �����������������. ��������� ������ C++��������� STL��� for_each(..) ������ ��������� ��������� ����� 구��������� ���기��� ���������.
Java 1.5 ��� advanced for statement ������ ������������ ��������� ����� �����������고, C#������ �������� ������ ������ ������ ���������������. Java 1.5��������� ������간 ������ ������ ��������� ���������, ��������� ������기 ������������ Autoboxing/Unboxing과 ������������ ������ Template과 ����� ������ �����������결���고 ������������(?)��� 개������ ������ ��������������������.
ref : Python Lib ref, Python Language ref, ��������������
--NeoCoin
--NeoCoin