파이썬 Add another tuple to a tuple of tuples
다음 튜플 튜플이 있습니다. my_choices=( ('1','first choice'), ('2','second choice'), ('3','third choice') ) 시작 부분에 다른 튜플을 추가하고 싶습니다. another_choice = ('0', 'zero choice') 어떻게 할 수 있습니까? 결과는 다음과 같습니다. final_choices=( ('0', 'zero choice') ('1','first choice'), ('2','second choice'), ('3','third choice') ) 해결 방법 another_choice 에서 다른 튜플 튜플을 만든 다음 연결합니다. final_choices = (another_choice,) + my_choices 또는 괄호 대신 대괄..
2020. 11. 9.