I want to print out the list name as a list element.

Asked 2 years ago, Updated 2 years ago, 45 views

I would like to save the declared list by MBTI as a variable called TotalStyle and print it out in the form of 'celebrity, MBTI' through double for statement.

According to the code I wrote, the TotalStyle element is in the list format, so it doesn't come out like an example. I'm a Python coding beginner, so I can't find the solution no matter how much I google it. I ask for your help.

(Example) Apink Chorong, ESFJ_F

  f [A Pink ' lantern ' and ', ' Namju ' and ', ' A ', ' Oh my girl Hyojeong ' and ', ' and ', ' promise ', Nine nojiseon]. _ esfj
ESFJ_M=['신화 앤디', '슈퍼주니어 규현', '슈퍼주니어 려욱', 'BTS 제이홉', '뉴이스트 민현', '황광희', 'AB6IX 이대휘', '유선호', '빅톤 허찬', '스트레이키즈 리노', '스트레이키즈 승민', '스트레이키즈 아이엔', '에이티즈 성화', '에이티즈 우영', '에이티즈 종호', '1TEAM 정훈', '김신영']
ISFJ_F=['브라운아이드걸스 나르샤', '트와이스 다현', '오마이걸 비니', 'ITZY 예지', '아이즈원 야부키나코', '프로미스나인 백지헌', '프로미스나인 이서연', '이달의소녀 진솔', '로켓펀치 소희', '로켓펀치 다현', '에버글로우 온다']
ISFJ_M=['동방신기 최강창민', '갓세븐 진영', '갓세븐 영재', '뉴이스트 종현', 'NCT 재민', 'NCT 도영', '세븐틴 정한', '엔플라잉 차훈', '업텐션 규진', '빅톤 한승우', '빅톤 강승식', '빅톤 임세준', '빅톤 최병찬', '크래비티 앨런', '베리베리 호영', '에이티즈 여상']
F [' Han ' and ', ' Jane ', ' this month's girl gimnip]. _ estj
M [' jyj Kim Jun-su, ' and ', ' won ' and ' the Pentagon]. _ estj
F [Girls ' Generation ' Sunny ' and ' praise aoa]. _ istj
M [' Infinite Seung-kyu, ' and ' ' and ' Got7 Mark ' and ', ' and ', ' 1 ' and ' team bc, ']. _ istj
F [Jun ', ', ' and ', ' and ', ' ’, ‘ Wonder Girls, So-hee Hye Olivia ' and ', ' this month ' and ' girls ' and ', ' apparent ', ' Kim ']. _ istp
M [Jinho, the Pentagon, ' and ' Dawn ' and ', ' A ' and ', ' and ', ' and ' Park ', ' and ', ' Kim ']. _ istp
ESTP_F=[]
M [' B2B Jung Il Hoon ' and ', ' The Day After Tomorrow ', by Together Taehyeon]. _ estp
F [' Swimming at the Girls ' Generation ', ' kard jeonsomin, ']. _ esfp
M [Jung Ji-hoon, ' Rain ' and ', ' ' and ', ' Ki Hyun ' and ' Golden Child ' queue, ', ' staging ' and ' The Boys ' bongjaeyeon, ' ab ix jeonung, h and d iangyeol, ']. _ esfp
M [' Top ' and ', ' ' and ', ' ' and ' B2B Seo Eunkwang ' and ', ' and ', ' and ', ' I Am ' and ' Day Six, which helped ' and ', ' The Day After Tomorrow ', by Together and Soobin studying abroad ' and ', ' Yeongbin ', ' kard jeisep, ']. _ isfp
F [' aoa, Sul Hyun, ' and ', ' Yoon Bomi ', ' Red velvet wisdom ' and ', ' and ', ' and ', ' ', ' (women) children, Sujin trained falcon how pass? ' and ' promise ' Nine janggyuri]. _ isfp
F [' Hee-jin, ' and ', ' soul ' and ' a girl of this month Tiffany of Girls ' Generation ']. _ entj
M [Leeteuk, ' SHINee ', ' Block B ' Zico as ' and ' Super Junior, ' and ' The Boys juangnyeon ' upwelling that is, ' and ' ' and ' beriberi]. _ entj
M [' Kang Dong-won nine multiple ' and ', ' Dragon ', ' sf]. _ intj
F [A pink Son Na-eun ' and ', ' ' and ' 2ne1 Minzy ']. _ intj
M [' bts a ' and ', ' and ', ' Six, Day J ' and ', ' and ', ' drafting ', ' sanggyun 84, ']. _ intp
F [A Pink, ' Jung Eunji, ' and ', ' ', ' Brown Eyed Girls Miryo ', ' (women) children ' plateau ' and ' the girl. meter glow of the month, Mia ' jeonsoyeon]. _ intp
F [' Sully ' Ye Eun, ' and ' and ' Wonder Girls ' and ', a girl of this month, nobody, but you ' and ', ' Do you, ' and ' demonstration ' and ' white friend or foe Min Kyung ' and ', ' test ' and ' iyeongji]. _ entp
M [' B2B Yook Sung Jae, ' and ', ' Park Kyung ' and ' Day Six yeongkei ' and ', ' star ' and ' The Boys Seonu ' and ', ' Lee Chan Hyuk, Mr. teuchot the Assisted ']. _ entp
ENFJ_M=['엑소 수호', '엑소 찬열', 'BTS 지민', 'JYJ 김재중', '강다니엘', '빅스 켄', '갓세븐 잭슨', '몬스타엑스 민혁', '세븐틴 민규', '세븐틴 조슈아', '세븐틴 디노', 'iKON 송윤형', '엔플라잉 재현', '데이식스 성진', '비투비 프니엘']
F [' itzy ' and ', ' and ', ' girlfriend ', ' Yuna Yerin ' and ', ' ', ' Park Mi-sun]. _ enfj
F [' cool ' and ', ' so ' and ', ' A ', ' Oh my girl Luda Seung-hee, ' and ', ' and ', ' space ', ' girl ' and ' Eve ' of the month]. _ infj
M [' Big Bang the sun, ' and ' ' and ' Biggs ' Leo ' and ', ' and ', ' and ', ' ', ' Seventeen ' tallow]. _ infj
F [' Lee ' and ', ' and ', ' and ', ' ' and ' Hong Jin-young, ' and ', ' but ' and ', ' advance ', ' (woman) children ', ' aftershocks ' of the month, ' girl of the month choeri]. _ enfp
ENFP_M=['헨리', 'BTS 뷔', 'BTS 알엠', 'iKON 구준회', 'iKON 김동혁', '펜타곤 우석', '몬스타엑스 주헌', 'NCT 해찬', '세븐틴 버논', '세븐틴 승관', '투모로우바이투게더 연준', '투모로우바이투게더 휴닝카이', '스트레이키즈 필릭스', '스트레이키즈 창빈', '대도서관', '조세호']
INFP_F=['아이유', '백예린', '원더걸스 선미', '티아라 지연', '에이핑크 오하영', '트와이스 채영', '트와이스 모모', '레드벨벳 조이', '레드벨벳 예리', '에이프릴 나은', '여자친구 소원', '오마이걸 아린', '우주소녀 보나', '우주소녀 설아', '정려원', '민효린', '배두나', '김숙']
INFP_M=['샤이니 태민', 'BTS 정국', '에픽하이 타블로', '하이라이트 윤두준', '아스트로 문빈', '갓세븐 유겸', 'iKON 바비', '데이식스 원필', '몬스타엑스 형원', '세븐틴 도겸', '세븐틴 에스쿱스', '세븐틴 준', '세븐틴 호시', '넬 김종완', '스트레이키즈 현진', '유아인']

TotalStyle = [ESFJ_F, ESFJ_M, ISFJ_F, ISFJ_M, ESTJ_F, ESTJ_M, ISTJ_F, ISTJ_M, ISTP_F, ISTP_M, ESTP_F, ESTP_M, ESFP_F, ESFP_M, ISFP_M, ISFP_F, ENTJ_F, ENTJ_M, INTJ_M, INTJ_F, INTP_M, INTP_F, ENTP_F, ENTP_M, ENFJ_M, ENFJ_F, INFJ_F, INFJ_M, ENFP_F, ENFP_M, INFP_F, INFP_M]

for M_Style in TotalStyle:
    for i in M_Style:
            print(str(i), str(M_Style))
        break
    break

python list

2022-09-20 08:41

2 Answers

MBTI = {}
Mbti [The f _ esfj] = [A Pink ' lantern ' and ', ' Namju ' and ', ' A ', ' Oh my girl Hyojeong ' and ', ' and ', ' promise ', Nine nojiseon].
MBTI["ESFJ_M"] = ['신화 앤디', '슈퍼주니어 규현', '슈퍼주니어 려욱', 'BTS 제이홉', '뉴이스트 민현', '황광희', 'AB6IX 이대휘', '유선호', '빅톤 허찬', '스트레이키즈 리노', '스트레이키즈 승민', '스트레이키즈 아이엔', '에이티즈 성화', '에이티즈 우영', '에이티즈 종호', '1TEAM 정훈', '김신영']
MBTI["ISFJ_F"] = ['브라운아이드걸스 나르샤', '트와이스 다현', '오마이걸 비니', 'ITZY 예지', '아이즈원 야부키나코', '프로미스나인 백지헌', '프로미스나인 이서연', '이달의소녀 진솔', '로켓펀치 소희', '로켓펀치 다현', '에버글로우 온다']
MBTI["ISFJ_M"] = ['동방신기 최강창민', '갓세븐 진영', '갓세븐 영재', '뉴이스트 종현', 'NCT 재민', 'NCT 도영', '세븐틴 정한', '엔플라잉 차훈', '업텐션 규진', '빅톤 한승우', '빅톤 강승식', '빅톤 임세준', '빅톤 최병찬', '크래비티 앨런', '베리베리 호영', '에이티즈 여상']
Mbti [The f _ estj] = [' Han ' and ', ' Jane ', ' this month's girl gimnip].
Mbti [The m _ estj] = [' jyj Kim Jun-su, ' and ', ' won ' and ' the Pentagon].
Mbti [The f _ istj] = [Girls ' Generation ' Sunny ' and ' praise aoa].
Mbti [The m _ istj] = [' Infinite Seung-kyu, ' and ' ' and ' Got7 Mark ' and ', ' and ', ' 1 ' and ' team bc, '].
Mbti [The f _ istp] = [Jun ', ', ' and ', ' and ', ' ’, ‘ Wonder Girls, So-hee Hye Olivia ' and ', ' this month ' and ' girls ' and ', ' apparent ', ' Kim '].
Mbti [The m _ istp] = [Jinho, the Pentagon, ' and ' Dawn ' and ', ' A ' and ', ' and ', ' and ' Park ', ' and ', ' Kim '].
MBTI["ESTP_F"] = []
Mbti [The m _ estp] = [' B2B Jung Il Hoon ' and ', ' The Day After Tomorrow ', by Together Taehyeon].
Mbti [The f _ esfp] = [' Swimming at the Girls ' Generation ', ' kard jeonsomin, '].
MBTI["ESFP_M"] = ['정지훈 비', 'CIX 배진영', '몬스타엑스 기현', '골든차일드 봉재현', '더보이즈 상연', '더보이즈 큐', 'AB6IX 전웅', 'H&D 이한결']
Mbti [The m _ isfp] = [' Top ' and ', ' ' and ', ' ' and ' B2B Seo Eunkwang ' and ', ' and ', ' and ', ' I Am ' and ' Day Six, which helped ' and ', ' The Day After Tomorrow ', by Together and Soobin studying abroad ' and ', ' Yeongbin ', ' kard jeisep, '].
Mbti [The f _ isfp] = [' aoa, Sul Hyun, ' and ', ' Yoon Bomi ', ' Red velvet wisdom ' and ', ' and ', ' and ', ' ', ' (women) children, Sujin trained falcon how pass? ' and ' promise ' Nine janggyuri].
Mbti [The f _ entj] = [' Hee-jin, ' and ', ' soul ' and ' a girl of this month Tiffany of Girls ' Generation '].
Mbti [The m _ entj] = [Leeteuk, ' SHINee ', ' Block B ' Zico as ' and ' Super Junior, ' and ' The Boys juangnyeon ' upwelling that is, ' and ' ' and ' beriberi].
Mbti [The m _ intj] = [' Kang Dong-won nine multiple ' and ', ' Dragon ', ' sf].
Mbti [The f _ intj] = [A pink Son Na-eun ' and ', ' ' and ' 2ne1 Minzy '].
Mbti [The m _ intp] = [' bts a ' and ', ' and ', ' Six, Day J ' and ', ' and ', ' drafting ', ' sanggyun 84, '].
Mbti [The f _ intp] = [A Pink, ' Jung Eunji, ' and ', ' ', ' Brown Eyed Girls Miryo ', ' (women) children ' plateau ' and ' the girl. meter glow of the month, Mia ' jeonsoyeon].
MBTI["ENTP_F"] = ['설리', '한예슬', '원더걸스 예은', '제시', '이달의소녀 츄', '라미란', '에버글로우 시현', '희나피아 민경', '트림캐쳐 시연', '이영지']

Mbti [The m _ entp] = [' B2B Yook Sung Jae, ' and ', ' Park Kyung ' and ' Day Six yeongkei ' and ', ' star ' and ' The Boys Seonu ' and ', ' Lee Chan Hyuk, Mr. teuchot the Assisted '].
MBTI["ENFJ_M"] = ['엑소 수호', '엑소 찬열', 'BTS 지민', 'JYJ 김재중', '강다니엘', '빅스 켄', '갓세븐 잭슨', '몬스타엑스 민혁', '세븐틴 민규', '세븐틴 조슈아', '세븐틴 디노', 'iKON 송윤형', '엔플라잉 재현', '데이식스 성진', '비투비 프니엘']
Mbti [The f _ enfj] = [' itzy ' and ', ' and ', ' girlfriend ', ' Yuna Yerin ' and ', ' ', ' Park Mi-sun].
Mbti [The f _ infj] = [' cool ' and ', ' so ' and ', ' A ', ' Oh my girl Luda Seung-hee, ' and ', ' and ', ' space ', ' girl ' and ' Eve ' of the month].
Mbti [The m _ infj] = [' Big Bang the sun, ' and ' ' and ' Biggs ' Leo ' and ', ' and ', ' and ', ' ', ' Seventeen ' tallow].
Mbti [The f _ enfp] = [' Lee ' and ', ' and ', ' and ', ' ' and ' Hong Jin-young, ' and ', ' but ' and ', ' advance ', ' (woman) children ', ' aftershocks ' of the month, ' girl of the month choeri].
MBTI["ENFP_M"] = ['헨리', 'BTS 뷔', 'BTS 알엠', 'iKON 구준회', 'iKON 김동혁', '펜타곤 우석', '몬스타엑스 주헌', 'NCT 해찬', '세븐틴 버논', '세븐틴 승관', '투모로우바이투게더 연준', '투모로우바이투게더 휴닝카이', '스트레이키즈 필릭스', '스트레이키즈 창빈', '대도서관', '조세호']
MBTI["INFP_F"] = ['아이유', '백예린', '원더걸스 선미', '티아라 지연', '에이핑크 오하영', '트와이스 채영', '트와이스 모모', '레드벨벳 조이', '레드벨벳 예리', '에이프릴 나은', '여자친구 소원', '오마이걸 아린', '우주소녀 보나', '우주소녀 설아', '정려원', '민효린', '배두나', '김숙']
MBTI ["INFP_M"] = ["SHINee Taemin", "BTS Jungkook", "Epik High Tablo", "Highlight Yoon Doo-joon", "ASTRO MOON BIN", "GOT7 YUGYEOM", "iKON Bobby", "DAY6 Wonpil", "SEVENTEEN SCOUPS", "SEVENTEEN", "JUNKIN"]

for mbti, names in MBTI.items():
    for name in names:
        print(f"{name}, {mbti}")


2022-09-20 08:41

I don't know how to call a variable name. It's possible to do it this way.

dict_a = {
'a': [],
'b': [],
}

for k, v in dict_a.items():
    for i in v:
        print(i, k)


2022-09-20 08:41

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.