상세 컨텐츠

본문 제목

파이썬 기초문법 2

python

by bumychoi 2024. 7. 3. 21:24

본문

3. 타입케스팅

x="Seoul"
y='25'
z=x+y
print(f'x+y:{z}')

 

# str' object is not callable
etc="KOREASEOUL"
print(etc())

 

 

    print(etc())
          ^^^^^
TypeError: 'str' object is not callable

c=[1,2,3,4,5]
print(c['2'])
 

TypeError: list indices must be integers or slices, not str

c=[1,2,3,4,5]
print(c[2])

'python' 카테고리의 다른 글

파이썬 기초(슬라이씽)  (0) 2024.07.04
파이썬 기초문법 3  (0) 2024.07.03
파이썬 기초문법  (0) 2024.07.03
단어공부 앱  (0) 2024.06.30
기본기 다지기 -예외규정  (0) 2024.06.29

관련글 더보기