강의

멘토링

로드맵

Inflearn Community Q&A

supremesang0427's profile image
supremesang0427

asked

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

함수 실행 후 None 이 출력

Resolved

Written on

·

11K

0

함수 실행 후 None 이 마지막에 출력이 되는데 이유를 알고 싶습니다 ㅠㅠ

그리고 None이 안나오게 하는 방법도 알고 싶습니다 ㅠ

감사합니다

웹-크롤링python

Answer 3

3

funcoding님의 프로필 이미지
funcoding
Instructor

안녕하세요.

구구단 ~ 2 X 9 = 18 은 multi_table() 함수안에 있는 print 문을 통해서 출력이 된 것입니다.

None 은 print(multi_table(num)) 구문에서, multi_table() 함수의 리턴값이 print 문에 의해 출력이 된 것인데요.

해당 함수의 리턴값을 정해놓지 않앗기 때문에, None이 출력된 것이예요.

해당 함수에서의 출력만 해보시려 하신 듯 한데, 그렇다면, print 문 없이 다음과 같이만 작성하시면 될 것 같습니다.

num = int(input())

multi_table(num)

감사합니다.

1

funcoding님의 프로필 이미지
funcoding
Instructor

이런 답글을 주시니 힘이 나네요 ㅎㅎ

1

MireeneSang님의 프로필 이미지
MireeneSang
Questioner

완전 너무 감사합니다 !!!

supremesang0427's profile image
supremesang0427

asked

Ask a question