본문 바로가기

취준생341

Udemy : Python 딕셔너리 Udemy : Python 딕셔너리 딕셔너리 name = { "Alex" : 2; "Lisa" : 1; "Joon" : 1; } "Alex", "Lisa", "Joon" 은 key 2, 1, 1은 value들이다. 즉 key의 값들이다 딕셔너리는 key를 통해서 값을 가지고 올 수 있다 name["Alex"] 는 2로 출력된다 name = { "Alex" : 2, "Lisa" : 1, "Joon" : 1, } print(name["Alex"]) # 2 name["Yang"] = 5 print(name) # { # "Alex" : 2, # "Lisa" : 1, # "Joon" : 1, # "Yang" : 5, # } # Yang이 key로, 5가 Yang의 값으로 추가가 되었다 name["Joon"] = .. 2023. 1. 10.
인공지능 - 지식 표현 인공지능 - 지식 표현 K-MOOC 인공지능 만들기 상식적 지식 기계가 인간들의 일반 상식을 가지게 할 수 있는지가, 아직 풀리지 않은 숙제이다 인간들에게는 너무나도 당연한 것은 기계들을 추론을 못 할 수 있다 예) 컵이 떨어지면, 컵이 깨진다는 인간들에게는 너무 당연한 것이다. 하지만 로봇은 아직 컵이 떨어지면, 컵이 깨진다는 추론을 못 할 수도 있다 지식 표현의 세 가지 방법 Semantic Network (의미망) 인공지능에서 지식 표현을 위한 그래프 구조 노드와 링크로 구성된 그래프 구조다 위 같은 경우 Jerry가 동물이란 것을 알기 위해, Jerry는 고양이라는 노드로 옮기고, 고양이는 mammal이라는 노드로 옮기고, 그리고 mammal은 동물이다 라는 노드까지 가야, Jerry가 동물이다 .. 2023. 1. 10.
Udemy : Python 매개변수와 Caesar Code Udemy : Python 매개변수와 Caesar Code 입력값을 받는 함수를 알게 될 것 Arguments 와 Parameters의 차이 입력 값이 있는 함수 # 그 전에 배웠던 함수 def greet(): print("Hello") print("Alex") greet() # 괄호에 아무것도 안 넣었다 def greet_with_name(name): print("Hello") print(name) greet_with_name('Alex') # greet_with_name() 안에 입력값을 넣어야 함수가 실행이 된다 # 그 입력값은 하나의 변수의 역할을 한다 # 괄호 안에 아무것도 없으면 argument가 없다고 에러 메세지가 뜬다 # TypeError: greet_with_name() missing .. 2023. 1. 9.
인공지능 - 규칙 기반 시스템 인공지능 - 규칙 기반 시스템 K-MOOC 인공지능 만들기 규칙 기반 시스템 규칙 형태로 된 표현을 써서 어떤 시스템을 모델링 하는 방법 지식 선언적 지식 사실, 문제 절차적 지식 방법, 쇼핑 절차 쇼핑을 할 때에 어떤 것을 살지 고르고, 계산하는 것 도메인 지식 추론의 대상, 구조, 관계 전략적 지식 추론하는 방법 어떤 추론 방법을 적용하는 것이 맞을까? 전문가 시스템 규칙 기반 시스템으로 인공지능 역사에서 산업화가 성공한 예 도메인 영역에서, 지식의 폭을 좁히고, 그 분야의 전문가의 많은 지식을 기계한테 넣는다 기계는 그 지식을 통해 추론을 한 후, 의사결정을 할 수 있도록 한다 Knowledge Base (KB) 지식 베이스 데이터 베이스에, 지식을 데이터화해서, 넣어둔 것 이 지식 (knowled.. 2023. 1. 9.
Udemy : Python 함수와 카렐 Udemy : Python 함수와 카렐 Function function() - 앞에 function의 이름이 있고, 뒤에 괄호가 붙는다 왜 사용는건가? 지속적으로 똑같은 코드를 쓰기보단, 함수로 만들어서, 그 함수를 지속적으로 사용하면 된다 코드를 줄일 때, 유용하게 쓸 수 있다 function 만들기 def my_function() : print("My Function") print("Wow") my_function() # 함수 부르기 While Loop while something_is_true: #Do this #Then do this #Then do this while문은, 써 놓은 조건이 거짓일때까지, 지속적으로 코드를 실행하는 것이다 확실한 길이의 데이터가 주어지지 않을 때 while문을 사용.. 2023. 1. 7.
5.3_Javascript - Sliding Window 문제풀이 Udemy - Javascript - Sliding Window Sliding Window - maxSubarraySum Given an array of integers and a number, write a function called maxSubarraySum, which finds the maximum sum of a subarray with the length of the number passed to the function. Note that a subarray must consist of consecutive elements from the original array. In the first example below, [100, 200, 300] is a subarray of the origi.. 2023. 1. 7.
5.2_Javascript - Multiple Pointers 문제풀이 Udemy - Javascript - Multiple Pointers Multiple Pointers - averagePair Multiple Pointers - averagePair Write a function called averagePair. Given a sorted array of integers and a target average, determine if there is a pair of values in the array where the average of the pair equals the target average. There may be more than one pair that matches the average target. Bonus Constraints: Time: O(N).. 2023. 1. 7.
5.1_Javascript - Frequency Counter 문제풀이 Udemy - Javascript - Frequency Counter Frequency Counter Write a function called sameFrequency. Given two positive integers, find out if the two numbers have the same frequency of digits. Your solution MUST have the following complexities: Time: O(N) Sample Input: sameFrequency(182,281) // true sameFrequency(34,14) // false sameFrequency(3589578, 5879385) // true sameFrequency(22,222) // false s.. 2023. 1. 7.
Udemy : Python 반복문 Udemy : Python 반복문 For 문으로 평균 구하기 student_heights = input("Input a list of student heights ").split() for n in range(0, len(student_heights)): student_heights[n] = int(student_heights[n]) total_height = 0 student_num = 0 for height in student_heights: total_height += height student_num += 1 print(round(total_height / student_num)) sum() 과 len()을 사용하지 않고 구하기 total_height : 학생들의 키를 구하기 student_num.. 2023. 1. 6.