강의

멘토링

커뮤니티

Inflearn Community Q&A

yeahgeelunar2915's profile image
yeahgeelunar2915

asked

Getting Started with Programming: Introduction to Python (Inflearn Original)

Character type (2-3)

capitalize 함수에 대한 질문

Written on

·

313

0

문자열 함수에 대한 강의를 들으며

예제들을 다 연습해보았는데, 강의 속 선생님 결과값과 달라 질문 드립니다.

str_u1 = python 으로 변수 선언을 한 뒤,

print(str_u1.capitalize) 로 출력해보니까

Python으로 결과값이 나오는게 아니라

<bulit-in method capitalize of str object at 0x109f53e30>

이라는 결과값이 나왔습니다ㅠㅠ

무언가 코드를 잘못 친걸까요?

python

Answer 3

2

niceman님의 프로필 이미지
niceman
Instructor

txt = "hello, and welcome to my world."

x = txt.capitalize()

print (x)

위와 같이 사용하세요! 함수를 호출해서요!

0

capitalize() 괄호를 빠트리신것 같아요.

함수니까 호출할때는() 괄호를 넣어줘야하는것 같네요.

0

감사합니다. 

근데 강의하고 똑같이 했는데 왜 저렇게 값이 뜬걸까요?ㅠㅠ

yeahgeelunar2915's profile image
yeahgeelunar2915

asked

Ask a question