분류 | 게시판 |
베스트 |
|
유머 |
|
이야기 |
|
이슈 |
|
생활 |
|
취미 |
|
학술 |
|
방송연예 |
|
방송프로그램 |
|
디지털 |
|
스포츠 |
|
야구팀 |
|
게임1 |
|
게임2 |
|
기타 |
|
운영 |
|
임시게시판 |
|
옵션 |
|
def repeat_string(x):
x += x
def repeat_list(x):
x.extend(x)
position = ["first", "second", "third", "fourth"]
double_position = position
repeat_list(double_position)
count = "123456789"
double_count = count
repeat_string(double_count)
print(position)
print(double_position)
print(count)
print(double_count)
출력값 :
["first", "second", "third", "fourth", "first", "second", "third", "fourth"] ["first", "second", "third", "fourth", "first", "second", "third", "fourth"] 123456789 123456789
여기서 왜 리스트는 position 하고 double_position 둘 다 반복되고 문자열은 그대로인지 전혀 모르겠어요.
죄송합니다. 댓글 작성은 회원만 가능합니다.