#python #anaconda #jupyter-notebook #visual-code #html #css #javascript #http

제목[웹파]박상근 교수님 quiz 질문2023-10-24 16:48
작성자

s = "Hello" 

s = s + "World" 

length = len(s[-5:0])

print(length)


답은 0.


질문: 

s = "Hello" 

s = s + "World" 

print(s[-5:0]) 

프린트 할떄는 syntaxerror가 뜨고


len(s[-5:0]) len 할떄는 0이 나오는데 error의 length는 error 아닌가요? 왜 0이 나오는 거죠?

댓글