websites = ["google.com", "naver.com", "facebook.com", "https://twitter.com"]
for website in websites:
# 만약 website의 앞이 https://가 아니라면?
if not website.startswith == "https://":
website = f"https://{website}"
print(website)
list
라는 자료구조를 사용함
list
라는 자료구조에 사용할 수 있는 method
인 startswith
을 이용해서 사이트 형식으로 표시되어있지 않은 사이트의 경우 https://
를 붙여줄 수 있도록 코드를 작성했다.