python/문자열
문자열 분할
june__Park
2021. 3. 1. 01:25
name = ["김철수" ,"이만수" , "이영희"]
score = [10, 20, 30]
data = "10/30/50"
# data의 점수랑 score 의 점수랑 같으면 이름출력
# 김철수 , 이영희
temp = data.split("/")
print(temp)
for i in range(len(temp)):
if int(temp[i]) == score[i]:
print(name[i],end = " ")