[python] 기초문법 01

서민지·2021년 10월 22일
0

텍스트 길이 세기

text = 'abcdefg'

result = len(text)

//결과값 
7

텍스트 길이 자르기

result = text[:3]
//결과값
abc


result = text[3:]
//결과값
defg

result = text[3:4]
//결과값
de

문자열 자르기

myemail = 'abc@gmail.com'
result = myemail.split(@)[1]
//결과값
gmail.com
profile
Do what I want for no regret

0개의 댓글