<pre style="overflow:auto;font-family:monospace, monospace;font-size:14px;color:#333333;">def repeat_string(x):<br> x += x<br><br>def repeat_list(x):<br> x.extend(x)<br><br>position = ["first", "second", "third", "fourth"]<br>double_position = position<br>repeat_list(double_position)<br><br>count = "123456789"<br>double_count = count<br>repeat_string(double_count)<br><br>print(position)<br>print(double_position)<br>print(count)<br>print(double_count)</pre><pre style="overflow:auto;font-family:monospace, monospace;font-size:14px;color:#333333;">출력값 :</pre><pre style="overflow:auto;font-family:monospace, monospace;font-size:14px;color:#333333;"></pre><pre style="overflow:auto;font-family:monospace, monospace;font-weight:bold;">["first", "second", "third", "fourth", "first", "second", "third", "fourth"] ["first", "second", "third", "fourth", "first", "second", "third", "fourth"] 123456789 123456789</pre><pre style="overflow:auto;font-family:monospace, monospace;font-weight:bold;"><br></pre><pre style="overflow:auto;font-family:monospace, monospace;font-weight:bold;">여기서 왜 리스트는 position 하고 double_position 둘 다 반복되고 문자열은 그대로인지 전혀 모르겠어요. </pre>
댓글 분란 또는 분쟁 때문에 전체 댓글이 블라인드 처리되었습니다.