인프런 영문 브랜드 로고
인프런 영문 브랜드 로고

Inflearn Community Q&A

smchu925718's profile image
smchu925718

asked

[Renewal] Python Introduction and Basic Crawling Bootcamp [Python, Web, Basic Data Understanding] (Updated)

Python Basics Learned Most Naturally While Solving Problems: Utilizing Loops and Various Data Structures 2

Exercise 53번 문항

Written on

·

169

1

Exercise 53번 문제에서, 마지막코드인 tuple(data)를 하고 type(data)를하면 계속 list라고 나옵니다.. ㅠㅠ 그래서 변수로 지정해서 a=tuple(data) 했더니 튜플로나오구요,,

웹-크롤링python

Answer 3

0

funcoding님의 프로필 이미지
funcoding
Instructor

네 맞습니다 문제에서 원하는 바도 맞습니다

0

smchu925718님의 프로필 이미지
smchu925718
Questioner

아하 그러면 출력만 튜플형태가 되도록 해달라는 것이고 실제로 변수로 넣어줘야 튜플로 정의된다는 말씀으로 이해해도 될까요?

0

funcoding님의 프로필 이미지
funcoding
Instructor

안녕하세요. 당연합니다.

tuple(data) 를 통해 최종 출력물만 튜플형태가 되도록 해달라는 것이 문제에서 원하는 바여서요. data 자체는 다음 코드에서 정의되는 구문이 하나이고, 이 때 리스트로 정의되었습니다. 말씀하신 부분은 a 라는 변수를 튜플 변수로 만든 것이 됩니다.

tupledata = ('fun-coding1', 'fun-coding2', 'fun-coding3')

data = list(tupledata)

data.append('fun-coding4')

tuple(data)

smchu925718's profile image
smchu925718

asked

Ask a question