본문 바로가기

Python_Matter

(328)
Python Learn the basics Quiz 40 Q>You are given a string where you have to find its first word.(당신은 첫 단어를 찾아야 만하는 문자열을 받게됩니다.)When solving a task pay attention to the following points:(작업을 해결할 때 다음 사항에주의하십시오.)There can be dots and commas in a string.(문자열에는 점과 쉼표가있을 수 있습니다.)A string can start with a letter or, for example, a dot or space.(문자열은 문자 또는 도트 또는 공백으로 시작할 수 있습니다.)A word can contain an apostrophe and it's a part of a wo..
Python Learn the basics Quiz 39 Q>For the input of your function, you will be given one sentence. You have to return a corrected version, that starts with a capital letter and ends with a period (dot).(함수의 입력을 위해, 당신은 한 문장을 받게 될 것입니다. 대문자로 시작하고 마침표 (점)로 끝나는 수정 된 버전을 반환해야합니다.)Pay attention to the fact that not all of the fixes are necessary. If a sentence already ends with a period (dot), then adding another one will be a mista..
Python Learn the basics Quiz 38 Q>We have prepared a set of Editor's Choice Solutions. You will see them first after you solve the mission. In order to see all other solutions you should change the filter.(우리는 Editor 's Choice Solutions 세트를 준비했습니다. 선교사를 해결 한 후에 그들을 먼저 볼 것입니다. 다른 모든 솔루션을 보려면 필터를 변경해야합니다.)In this mission you should write a function that introduce a person with a given parameters in attributes.(이 임무에서는 속성에 주어진 매개..
Python Learn the basics Quiz 37 Q>10명으로 구성된 학급에 반장 선거를 한다.10명의 투표내용을 기호순으로 입력 받고 후보별 득표 수를 인쇄하여 최다득표자의 기호를 인쇄하시오. A>def str2int(slist): nlist = [] for s in slist: nlist.append(int(s)) return nlist def countvotes(votes, numbers): earns = [0] * numbers no = 0 for vote in votes: index = vote - 1 if 0 총 후보자가 몇 명입니까? 10투표내용: 7 2 4 5 6 8 10 2 3 4기호: 1 득표 수: 0기호: 2 득표 수: 2기호: 3 득표 수: 1기호: 4 득표 수: 2기호: 5 득표 수: 1기호: 6 득표 수: 1기호: 7 득표 수..
Python Learn the basics Quiz 36 Q>메뉴수행 명령어 r 승객이름 항공편항공 예약f 항공편항공편에 예약된 승객 출력p 승객이름 승객이름에 예약한 항공편을 출력 q프로그램 종 항공편 예약 시스템을 작성하시오.승객이름은 중복 될수 없다,동일 예약 판단 구문 작성하시오. A>database = [] def reserve(p, f): global database if [p, f] not in database: database.append([p, f]) else: print("동일 예약이 발견되었습니다.") def cancle(p, f): global database if [p, f] in database: database.remove([p, f]) else: print("동일 예약이 발견되지 않았습니다.") def flight(f): globa..
Python Learn the basics Quiz 35 Q>(2017년)KAKAO BLIND RECRUITMENT네오는 평소 프로도가 비상금을 숨겨놓는 장소를 알려줄 비밀지도를 손에 넣었다.그런데 이 비밀지도는 숫자로 암호화되어 있어 위치를 확인하기 위해서는 암호를 해독해야 한다.다행히 지도 암호를 해독할 방법을 적어놓은 메모도 함께 발견했다.지도는 한 변의 길이가 n인 정사각형 배열 형태로, 각 칸은 공백(" ) 또는벽(#") 두 종류로 이루어져 있다.전체 지도는 두 장의 지도를 겹쳐서 얻을 수 있다. 각각 지도 1과 지도 2라고 하자.지도 1 또는 지도 2 중 어느 하나라도 벽인 부분은 전체 지도에서도 벽이다.지도 1과 지도 2에서 모두 공백인 부분은 전체 지도에서도 공백이다.지도 1과 지도 2는 각각 정수 배열로 암호화되어 있다.암호화된 배열은 지도의 ..
Python Learn the basics Quiz 34 Q>사용자에게 연간 총수입 / 소득 공제액을 입력 받아 순월수입을 계산하시오.- 소득세(tax) = (연간 총수입(income) - 소득공재액(duty)) * 0.2(taxrate)- 순 연수입(year) = 연간 총수입(income) - 소득세(tax)- 순 월수입(month) = 순 연수입(year) / 12- 세율 : 0.2 A>taxrate = 0.2 income = int(input("연간 총수입 :")) duty = int(input("소득 공제액 :")) tax = (income - duty) * taxrate year = income - tax month = year / 12 print("\n소득세 %.1f를 제외한 순월수입은 %.2f입니다."%(tax,month)) print("소득세 %..
Python Learn the basics Quiz 33 Q>사용자에게 암호를 입력받아 사용 가능 / 불가능 여부를 판단하시오.암호 조건- 중복되는 숫자 불가능- 4자리 모두 1씩 증가되면 안된다.- 4자리 모두 1씩 감소되면 안된다. A>password = input("사용하고자 하는 암호를 입력하세요: ") p1 = int(password[0]) p2 = int(password[1]) p3 = int(password[2]) p4 = int(password[3]) duplicate = p1 == p2 or p1 == p3 or p1 == p4 or p2 == p3 or p2 == p4 or p3 == p4 increment = p1 + 1 == p2 and p2 + 1 == p3 and p3 + 1 == p4 decrement = p1 - 1 == p2 an..