Python 20

[파이썬 300제] 61~70

파이썬 300제 51~60 개인 기록용 https://wikidocs.net/7025 061 ~ 070 .answer {margin-top: 10px;margin-bottom: 50px;padding-top: 10px;border-top: 3px solid LightGray;bo… wikidocs.net 61. price = ['20180728',100,130,140,150,160,170]일 때 날짜 정보를 제외하고 가격 정보만 출력 답 : price = ['20180728',100,130,140,150,160,170] print(price[1:]) 62. nums = [1,2,3,4,5,6,7,8,9,10]일 때 슬라이싱을 사용하여 홀수만 출력 답 : nums = [1,2,3,4,5,6,7,8,9,10..

Python 2023.01.17

[파이썬 300제] 51~60

파이썬 300제 51~60 개인 기록용 https://wikidocs.net/7023 051 ~ 060 .answer {margin-top: 10px;margin-bottom: 50px;padding-top: 10px;border-top: 3px solid LightGray;bo… wikidocs.net 51. 2016년 11월 영화 TOP3 순위가 아래와 같을 때, 영화 제목을 movie_rank 이름의 리스트에 저장 순위 제목 1 닥터 스트레인지 2 스플릿 3 럭키 답 : movie_rank = ["닥터 스트레인지", "스플릿", "럭키"] 52. movie_rank 리스트에 "배트맨" 추가 답 : movie_rank.append("배트맨") 53. movie_rank=['닥터 스트레인지', '스플릿..

Python 2023.01.11

[파이썬 300제] 41~50

파이썬 300제 41~50 개인 기록용 https://wikidocs.net/78558 041 ~ 050 .answer {margin-top: 10px;margin-bottom: 50px;padding-top: 10px;border-top: 3px solid LightGray;bo… wikidocs.net 41. ticker = "btc_krw"를 "BTC_KRW"로 변경 답 : ticker="btc_krw" ticker.upper() 42. ticker = "BTC_KRW"를 "btc_krw"로 변경 답 : ticker="BTC_KRW" ticker.lower() 43. 문자열 'hello'를 'Hello'로 변경 답 : qu="hello" qu.capitalize() 44. endswith 메서드를 ..

Python 2023.01.07

[파이썬 300제] 31~40

파이썬 300제 31~40 개인 기록용 https://wikidocs.net/7024 031 ~ 040 .answer {margin-top: 10px;margin-bottom: 50px;padding-top: 10px;border-top: 3px solid LightGray;bo… wikidocs.net 31. a="3", b="4"일 때 print(a+b)의 결과 답 : 34 a,b 모두 문자열이기 때문에 3+4=34 출력 32. print("Hi"*3)의 결과 답 : HiHiHi "Hi"라는 단어가 3번 반복(*3)되므로 HiHiHi 출력 33. '-'을 80개 출력 답 : print("-"*80) 34. t1='Python', t2='Java'일 때 +,*를 이용하여 Python Java Pytho..

Python 2023.01.05

[파이썬 300제] 21~30

파이썬 300제 21~30 개인 기록용 https://wikidocs.net/7022 021 ~ 030 .answer {margin-top: 10px;margin-bottom: 50px;padding-top: 10px;border-top: 3px solid LightGray ... wikidocs.net 21. "python"이 바인딩하는 문자열에서 첫번째와 세번째 문자 출력 답 : a="python" print(a[0], a[2]) 22. 자동차 번호가 "24가 2210"일 때 뒤에 4자리만 출력 답 : a="24가 2210" print(a[-4:]) 23. "홀짝홀짝홀짝" 문자열에서 "홀"만 출력 답 : a="홀짝홀짝홀짝" print(a[::2]) //시작인덱스:끝인덱스:간격(step) 24. "PY..

Python 2022.07.20