서영#70
서영#70

Calculating the rfind() function

If we use rfind here to find the string "class", isn't it the 6th rather than the 8th?

text = "파이썬 수업, 수업은 재미있다"

# text 문자열 변수의 시작부터 "수업" 문자열의 시작 위치 반환
position = text.rfind("수업")

# 오른쪽에서 첫 번째 "수업" 문자열의 시작 위치 반환
print(position)
Comment
No comment