강의

멘토링

커뮤니티

Inflearn Community Q&A

smchu925718's profile image
smchu925718

asked

[Renewed] Python Introduction and Web Scraping Basics Bootcamp [Python, Web, Data Understanding Fundamentals] (Updated)

Python Fundamentals Through Natural Problem-Solving Practice: Loops and Various Data Structure Applications 2

Exercise 53번 문항

Written on

·

180

1

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

웹-크롤링python

Answer 3

0

funcoding님의 프로필 이미지
funcoding
Instructor

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

0

Seungmin Chu님의 프로필 이미지
Seungmin Chu
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