수강이 제한됩니다.
다른 수강생들이 자주 물어보는 질문이 궁금하신가요?
- 미해결프로그래밍, 데이터 과학을 위한 파이썬 입문
while 조건문
def main(): user_input = 999 while(user_input != 0): user_input = input("Input a positive number : ") if is_positive_number(user_input) == True: factorial_value = get_factorial_value(user_input) print(factorial_value) elif user_input != '0': print("Input again, Please") elif user_input == '0': print("Thank you for using this program") user_input = 0 맨 위의 0은 ''가 들어가지 않는데 아래 두개의 0에는 ''가 들어가야 하는 이유가 이해가 안되서 질문 드립니다!
- 미해결프로그래밍, 데이터 과학을 위한 파이썬 입문
main 이 제대로 작동하는데 계속 failed 가 뜹니다..
저도 아래와 같은 문제인데... 구글링을 해보고, 이리저리 수정도 해봤는데... main 이 과제 안내 스크린샷처럼 잘 운영됨에도 계속 failed 라고 뜹니다.. ㅠㅠ 과제 관련 해결 안 된다고 하시긴 하셨는데... 도저히 혼자 힘으로 해결이 안 되어 도움 요청드려도 될까요?
- 미해결프로그래밍, 데이터 과학을 위한 파이썬 입문
과제 제출시 오류
과제 제출을 하는데 아래와 같은 문구가 뜹니다 원인 및 해결 방법을 알 수 있을까요? Traceback (most recent call last): File "c:\users\user\miniconda3\lib\site-packages\aiohttp\connector.py", line 822, in _wrap_create_connection return await self._loop.create_connection(*args, **kwargs) File "c:\users\user\miniconda3\lib\asyncio\base_events.py", line 1050, in create_connection transport, protocol = await self._create_connection_transport( File "c:\users\user\miniconda3\lib\asyncio\base_events.py", line 1080, in _create_connection_transport await waiter File "c:\users\user\miniconda3\lib\asyncio\sslproto.py", line 529, in data_received ssldata, appdata = self._sslpipe.feed_ssldata(data) File "c:\users\user\miniconda3\lib\asyncio\sslproto.py", line 189, in feed_ssldata self._sslobj.do_handshake() File "c:\users\user\miniconda3\lib\ssl.py", line 944, in do_handshake self._sslobj.do_handshake() ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: certificate has expired (_ssl.c:1108) The above exception was the direct cause of the following exception: Traceback (most recent call last): File "c:\users\user\miniconda3\lib\site-packages\ai\backend\client\request.py", line 389, in __aenter__ raw_resp = await self.rqst_ctx.__aenter__() File "c:\users\user\miniconda3\lib\site-packages\aiohttp\client.py", line 855, in __aenter__ self._resp = await self._coro File "c:\users\user\miniconda3\lib\site-packages\aiohttp\client.py", line 367, in _request conn = await self._connector.connect( File "c:\users\user\miniconda3\lib\site-packages\aiohttp\connector.py", line 445, in connect proto = await self._create_connection(req, traces, timeout) File "c:\users\user\miniconda3\lib\site-packages\aiohttp\connector.py", line 756, in _create_connection _, proto = await self._create_direct_connection( File "c:\users\user\miniconda3\lib\site-packages\aiohttp\connector.py", line 879, in _create_direct_connection raise last_exc File "c:\users\user\miniconda3\lib\site-packages\aiohttp\connector.py", line 856, in _create_direct_connection transp, proto = await self._wrap_create_connection( File "c:\users\user\miniconda3\lib\site-packages\aiohttp\connector.py", line 824, in _wrap_create_connection raise ClientConnectorCertificateError( aiohttp.client_exceptions.ClientConnectorCertificateError: Cannot connect to host api.backend.ai:443 ssl:True [SSLCertVerificationError: (1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: certificate has expired (_ssl.c:1108)')] The above exception was the direct cause of the following exception: Traceback (most recent call last): File "c:\users\user\miniconda3\lib\runpy.py", line 194, in _run_module_as_main return _run_code(code, main_globals, None, File "c:\users\user\miniconda3\lib\runpy.py", line 87, in _run_code exec(code, run_globals) File "C:\Users\USER\miniconda3\Scripts\backend.ai.exe\__main__.py", line 7, in <module> File "c:\users\user\miniconda3\lib\site-packages\click\core.py", line 829, in __call__ return self.main(*args, **kwargs) File "c:\users\user\miniconda3\lib\site-packages\click\core.py", line 782, in main rv = self.invoke(ctx) File "c:\users\user\miniconda3\lib\site-packages\click\core.py", line 1259, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "c:\users\user\miniconda3\lib\site-packages\click\core.py", line 1066, in invoke return ctx.invoke(self.callback, **ctx.params) File "c:\users\user\miniconda3\lib\site-packages\click\core.py", line 610, in invoke return callback(*args, **kwargs) File "c:\users\user\miniconda3\lib\site-packages\ai\backend\client\cli\run.py", line 577, in run if is_legacy_server(): File "c:\users\user\miniconda3\lib\site-packages\ai\backend\client\session.py", line 24, in is_legacy_server ret = session.Kernel.hello() File "c:\users\user\miniconda3\lib\site-packages\ai\backend\client\base.py", line 21, in _method return cls.session.worker_thread.execute(coro) File "c:\users\user\miniconda3\lib\site-packages\ai\backend\client\session.py", line 64, in execute raise result File "c:\users\user\miniconda3\lib\site-packages\ai\backend\client\session.py", line 48, in run result = loop.run_until_complete(coro) File "c:\users\user\miniconda3\lib\asyncio\base_events.py", line 616, in run_until_complete return future.result() File "c:\users\user\miniconda3\lib\site-packages\ai\backend\client\kernel.py", line 46, in hello async with rqst.fetch() as resp: File "c:\users\user\miniconda3\lib\site-packages\ai\backend\client\request.py", line 399, in __aenter__ raise BackendClientError(msg) from e ai.backend.client.exceptions.BackendClientError: BackendClientError('Request to the API endpoint has failed.\nCheck your network connection and/or the server status.\n➜ ClientConnectorCertificateError()')
- 미해결프로그래밍, 데이터 과학을 위한 파이썬 입문
강의자료좀 보내주세요
강의와 관련있는 질문을 남겨주세요.• 강의와 관련이 없는 질문은 지식공유자가 답변하지 않을 수 있습니다. (사적 상담, 컨설팅, 과제 풀이 등)• 질문을 남기기 전, 비슷한 내용을 질문한 수강생이 있는지 먼저 검색을 해주세요. (중복 질문을 자제해주세요.)• 서비스 운영 관련 질문은 인프런 우측 하단 ‘문의하기’를 이용해주세요. (영상 재생 문제, 사이트 버그, 강의 환불 등) 질문 전달에도 요령이 필요합니다.• 지식공유자가 질문을 좀 더 쉽게 확인할 수 있게 도와주세요.• 강의실 페이지(/lecture) 에서 '질문하기'를 이용해주시면 질문과 연관된 수업 영상 제목이 함께 등록됩니다.• 강의 대시보드에서 질문을 남길 경우, 관련 섹션 및 수업 제목을 기재해주세요. • 수업 특정 구간에 대한 질문은 꼭 영상 타임코드를 남겨주세요! 구체적인 질문일수록 명확한 답을 받을 수 있어요.• 질문 제목은 핵심 키워드를 포함해 간결하게 적어주세요.• 질문 내용은 자세하게 적어주시되, 지식공유자가 답변할 수 있도록 구체적으로 남겨주세요.• 정확한 질문 내용과 함께 코드를 적어주시거나, 캡쳐 이미지를 첨부하면 더욱 좋습니다. 기본적인 예의를 지켜주세요.• 정중한 의견 및 문의 제시, 감사 인사 등의 커뮤니케이션은 더 나은 강의를 위한 기틀이 됩니다. • 질문이 있을 때에는 강의를 만든 지식공유자에 대한 기본적인 예의를 꼭 지켜주세요. • 반말, 욕설, 과격한 표현 등 지식공유자를 불쾌하게 할 수 있는 내용은 스팸 처리 등 제재를 가할 수 있습니다. 도저히 받을수가 없어요/...부탁드립니다,hzw94@nave.com입니다.
- 미해결프로그래밍, 데이터 과학을 위한 파이썬 입문
강의자료 링크 문의
강의자료 링크를 눌렀는데 항목이 존재하지 않는다고 나옵니다. PDF는 받아지는데 파이썬 파일을 받을수가 없네요 paintom@naver.com으로 강의자료를 일괄 받을 수 있을까요? 강의와 관련있는 질문을 남겨주세요.• 강의와 관련이 없는 질문은 지식공유자가 답변하지 않을 수 있습니다. (사적 상담, 컨설팅, 과제 풀이 등)• 질문을 남기기 전, 비슷한 내용을 질문한 수강생이 있는지 먼저 검색을 해주세요. (중복 질문을 자제해주세요.)• 서비스 운영 관련 질문은 인프런 우측 하단 ‘문의하기’를 이용해주세요. (영상 재생 문제, 사이트 버그, 강의 환불 등) 질문 전달에도 요령이 필요합니다.• 지식공유자가 질문을 좀 더 쉽게 확인할 수 있게 도와주세요.• 강의실 페이지(/lecture) 에서 '질문하기'를 이용해주시면 질문과 연관된 수업 영상 제목이 함께 등록됩니다.• 강의 대시보드에서 질문을 남길 경우, 관련 섹션 및 수업 제목을 기재해주세요. • 수업 특정 구간에 대한 질문은 꼭 영상 타임코드를 남겨주세요! 구체적인 질문일수록 명확한 답을 받을 수 있어요.• 질문 제목은 핵심 키워드를 포함해 간결하게 적어주세요.• 질문 내용은 자세하게 적어주시되, 지식공유자가 답변할 수 있도록 구체적으로 남겨주세요.• 정확한 질문 내용과 함께 코드를 적어주시거나, 캡쳐 이미지를 첨부하면 더욱 좋습니다. 기본적인 예의를 지켜주세요.• 정중한 의견 및 문의 제시, 감사 인사 등의 커뮤니케이션은 더 나은 강의를 위한 기틀이 됩니다. • 질문이 있을 때에는 강의를 만든 지식공유자에 대한 기본적인 예의를 꼭 지켜주세요. • 반말, 욕설, 과격한 표현 등 지식공유자를 불쾌하게 할 수 있는 내용은 스팸 처리 등 제재를 가할 수 있습니다.
- 미해결프로그래밍, 데이터 과학을 위한 파이썬 입문
Yesterday.txt 파일 경로에서 다운로드가 안 됩니다.
https://raw.githubusercontent.com/TeamLab/cs50_example_code/master/12_string/yesterday.txt 위 주소를 클릭해도 404 : Not Found 라며 다운로드가 안 됩니다.
- 미해결프로그래밍, 데이터 과학을 위한 파이썬 입문
다른 함수는 다 Pass인데 main 함수만 Fail입니다.
다른 건 다 통과했는데 main 함수만 fail이 나왔습니다. 실행했을 때는 잘 돌아가던데 어디가 문제일까요? def main(): print("Morse Code Program!!") # ===Modify codes below============= while 1: user_input = input("Input your message(H - Help, 0 - Exit): ") if is_help_command(user_input) is True: print(get_help_message()) elif user_input == "0": break elif is_validated_morse_code(user_input) is True: print(decoding_sentence(user_input)) elif is_validated_english_sentence(user_input) is True: print(encoding_sentence(user_input)) else: print("Wrong Input") # ================================== print("Good Bye") print("Morse Code Program Finished!!")
- 미해결프로그래밍, 데이터 과학을 위한 파이썬 입문
과제 확인 부탁드립니다.
dic은 처음에 주어진다고 가정을 하고 작성을 해 보았습니다. def value_key_back(i): user_dic = {"America": 1, "Korea": 82, "China": 86, "Japan": 81} user_key_list = list(user_dic.keys()) user_value_list = list(user_dic.values()) key_index_num = user_value_list.index(i) result = user_key_list[key_index_num] return result print('user_dic = {"America": 1, "Korea": 82, "China": 86, "Japan": 81}') dic_value = int(input("Input any value: ")) print("The Key is {0}". format(value_key_back(dic_value)))
- 미해결프로그래밍, 데이터 과학을 위한 파이썬 입문
is_positive_number 함수의 소수 판별
is positive_number 함수에 앞 영상에서 설명한 것과 같이 if int(integer_str_value) > 0: return True return False 이런식으로 코드를 작성했는데 이렇게 코드를 작성하면 32.2와 같은 소수점이 포함된 실수의 경우 리턴값이 True가 되지 않나요? 그런데 작성한 코드는 잘 돌아가는데 혹시 뭐 놓친게 있을까요? def is_positive_number(integer_str_value): try: # ===Modify codes below============= # 시작전 반드시 'pass'를 지울 것 if int(integer_str_value) > 0: return True return False # ================================== except ValueError: return False def get_factorial_value(integer_value): factorial_result = 1 while integer_value > 0: factorial_result = integer_value * factorial_result integer_value -= 1 # ================================== return factorial_result def main(): user_input = 999 # ===Modify codes below============= while user_input != "0": user_input = input("Input a positive number : ") if user_input == "0": print("Thank you for using this program") elif is_positive_number(user_input) == True: factorial_result = get_factorial_value(int(user_input)) print(factorial_result) else: print("Input again, Please") # ================================== if __name__ == "__main__": main()
- 미해결프로그래밍, 데이터 과학을 위한 파이썬 입문
submit.bat 코드를 실행하면 오류가 뜹니다!
안녕하세요:) 과제 제출하는 중에 오류가 떠서 문의드립니다! 숙제 제출 확인 메시지 밑에 이렇게 뜨고, 제출 과제 확인을 누르면 과제 제출 내역이 없다고 뜨는데, 어떻게 하면 되는 걸까요? 아 그리고 visual studio code를 쓰고 있는데, 미니콘다 대신 사용해도 괜찮은거죠? 답변 부탁드립니다! 감사합니다:)
- 미해결프로그래밍, 데이터 과학을 위한 파이썬 입문
가변인자 공부할 때 나타나는 오류
def asterisk_test_2(*args): x,y,z = args print(x) print(y) return sum(x,y) asterisk_test_2(3,4,5) 저는 가변인자를 활용했을 때, 가변인자 속 값들을 더해주는 코드를 작성해보고 싶었습니다. 하지만, 위와 같은 코드에서 int object is not literable이라고 뜨는데 그 이유를 잘 모르겠습니다.
- 미해결프로그래밍, 데이터 과학을 위한 파이썬 입문
for문과 while문의 차이
for문에서는 조건절에서 변수를 정의할 수 있고, while문에서는 조건절에서 변수를 정의할 수 없기 때문에, 반복문을 들어가기 전에 미리 변수를 정의하는 것 맞나요? 아니라면 while문도 마찬가지로 조건절에서 변수를 정의할 수 있는 것인가요?
- 미해결프로그래밍, 데이터 과학을 위한 파이썬 입문
number of cases 관련 질문입니다
a = len(list_data) new_list_data = [] for i in range(0,a): for j in range(0,a): b = str(list_data[i]) + str(list_data[j]) new_list_data.append(b) result = new_list_data # ================================== return result
- 미해결프로그래밍, 데이터 과학을 위한 파이썬 입문
더 간단한 코드를 작성한 것 같습니다. 한번 봐주세요!
kor_score = [49, 79, 20, 100, 80] math_score = [43, 59, 85, 30, 90] eng_score = [49, 79, 48, 60, 100] midterm_score = [kor_score, math_score, eng_score] student_average = [0,0,0,0,0] for i in range(0,5): sum = midterm_score[0][i] + midterm_score[1][i] + midterm_score[2][i] student_average[i] = sum / 3 print(student_average)
- 미해결프로그래밍, 데이터 과학을 위한 파이썬 입문
코드를 작성해보았습니다. 평가해주세요
user_input = int(input("구구단 1단부터 9단중 몇 단을 계산할까요? 종료를 원한다면 0을 눌러주세요 ")) while(user_input != 0): if type(user_input) == int: if user_input <= 9 and user_input >= 1: for i in range(1,10): result = user_input * i print(user_input,"X",i,"=",result) break else: user_input = int(input("1과 9 사이의 정수를 입력해주세요. 종료를 원한다면 0을 눌러주세요 ")) else: user_input = int(input("1과 9 사이의 정수를 입력해주세요. 종료를 원한다면 0을 눌러주세요 ")) else: print("종료하겠습니다.")
- 미해결프로그래밍, 데이터 과학을 위한 파이썬 입문
최적의 코드인지 궁금합니다.
import random guess_number = random.randint(1, 100) user_input = int(input("1과 100사이의 정수를 맞춰보세요. 5번의 기회가 있습니다. ")) while(user_input != guess_number): for i in range (0,5): if type(user_input) == int: if user_input < 100 and user_input > 1: if user_input < guess_number: user_input = int(input("입력하신 숫자보다 큽니다. 1과 100사이의 정수를 맞춰보세요: ")) elif user_input > guess_number: user_input = int(input("입력하신 숫자보다 작습니다. 1과 100사이의 정수를 맞춰보세요: ")) else: user_input = int(input("1과 100사이의 정수가 아닙니다. 1과 100사이의 정수를 다시 입력해주세요.: ")) else: user_input = int(input("정수가 아닙니다. 1과 100사이의 정수를 다시 입력해주세요.: ")) print("주어진 기회를 다 쓰셨습니다.") break else: print("축하합니다~! 맞추셨습니다!") 일단 코드를 작성하면서 1~100임의의 숫자를 맞추는 코드에다가 1~100사이의 임의의 숫자를 입력하지 않는 조건 + 5번의 기회를 주는 조건에 대해서도 추가로 생각해보았습니다. 제가 작성한 코드보다 더 간편하게 작성할 수 있는 방법이 있는지에 대해 알려주시면 감사하겠습니다.
- 미해결프로그래밍, 데이터 과학을 위한 파이썬 입문
작성 코드는 pass 했는데 업로드가 안됩니다
(사진)
- 미해결프로그래밍, 데이터 과학을 위한 파이썬 입문
리스트에서 리스트의 요소들을 extend를 사용해서 추가할때 맨뒤에가 아니라 맨앞이나 원하는 위치에 추가하려면 어떻게 해야 하나요??
가령 color = [4,5,6] 이렇게 있는데 color2 = [1,2,3]을 color의 맨앞에 추가 하고 싶을땐 (단, [[1,2,3],4,5,6]이게 아니라 [1,2,3,4,5,6]이렇게 요소들로 추가) 어떤 방식을 택해야 하나요? color.insert(0, color2)를 해도 [[1,2,3,],4,5,6] 이런식으로 되던데 혹시 방법이 있을까요?
- 미해결프로그래밍, 데이터 과학을 위한 파이썬 입문
다른 방식으로 코드를 작성해보았습니다.
수업 열심히 듣고 있습니다. 좋은 수업 감사합니다. 저는 연속적인 구구단 입력에 대한 코드를 다음과 같이 작성해보았습니다. ============================================= user_input = int(input("구구단 몇단을 작성할까요(1~9)? 종료하시려면 0을 입력해주세요. ")) while (user_input < 0 and user_input > 9): print("숫자를 잘못 입력하셨습니다. 다시 입력해주세요") user_input = int(input()) while(user_input != 0): print("구구단", user_input,"단을 작성합니다.") for i in range(1,10): result = user_input * i print(user_input, "X", i, "=", result) user_input = int(input("구구단 몇단을 작성할까요? ")) if(user_input == 0): break print("구구단 작성을 종료합니다.") ============================================= 개선점이나 잘못된 점을 알려주시면 감사하겠습니다.
- 미해결프로그래밍, 데이터 과학을 위한 파이썬 입문
5주차 강의자료
지금 계속 강의를 듣고 있는데요 5주차 강의자료가 없는거 같아요!