본문 바로가기

컴퓨터과학

(32)
[Common Lisp] [Codewars] 8Kyu - Grasshopper - Summation Codewars: Achieve mastery through coding challenge Codewars is a coding practice site for all programmers where you can learn various programming languages. Join the community and improve your skills in many languages! www.codewars.com 문제 Write a program that finds the summation of every number from 1 to num. The number will always be a positive integer greater than 0. For example: summation(2) ..
[SQL] [Codewars] 7Kyu - Countries Capitals for Trivia Night (SQL for Beginners #6) Codewars: Achieve mastery through coding challenge Codewars is a coding practice site for all programmers where you can learn various programming languages. Join the community and improve your skills in many languages! www.codewars.com 문제 Your friends told you that if you keep coding on your computer, you are going to hurt your eyes. They suggested that you go with them to trivia night at the lo..
[Common Lisp] [구름LEVEL] 16진수 구름LEVEL 코딩테스트에서 가장 높은 비중을 차지하는 알고리즘 문제를 제작하고 풀이할 수 있는 온라인 저지 서비스입니다. 기업에서 선호하는 C, C++, 파이썬(Python), 자바(Java), 자바스크립트(Javascript) 이 level.goorm.io 문제 입력 받은 10진수를 16진수로 출력하는 프로그램을 작성하십시오. 코드 (setq n (format nil "~X" (read))) (write-string (string-downcase n)) 설명 아래와 같이 간단하게 풀려고 했으나, (write-string (format nil "~X" (read))) 16진수의 소문자 출력을 요구하기에, 구한 16진수를 그냥 소문자 처리 해버렸다. 조금 찜찜하지만, 일단 여기까지.
[SQL] [Codewars] 7Kyu - Hello SQL World! Codewars: Achieve mastery through challenge Codewars is where developers achieve code mastery through challenge. Train on kata in the dojo and reach your highest potential. www.codewars.com 문제 Hello SQL! Return a table with a single column named Greeting with the phrase 'hello world!' 코드 SELECT 'hello world!' as "Greeting" 설명 SQL에서 문자열을 출력하는데 SELECT를 사용할 수 있다. 출력할 문자열은 작은따옴표로 묶어줘야 한다. 또한, SQL에서 ..
[Python 3] matplotlib으로 기초 그래프 그리기 'matplotlib'은 기본으로 내장되어 있지 않기 때문에 사용 전 설치가 선결돼야 한다. cmd에서 pip install matplotlib을 입력하여 설치한다. from pylab import plot, show pm_seoul = [2, 2, 2, 1, 0, 0, 1, 2, 3, 6] years = range(2007, 2017) plot(years, pm_seoul) show() 먼저 pylab 모듈에서 plot함수와 show함수를 불러온다. plot함수는 plot(x축 리스트, y축 리스트)과 같이 사용되며, show함수는 그린 그래프를 화면을 통해 보여주는 기능이 있다. 3, 4번 줄은 서울특별시 미세먼지 연도별 발령횟수를 2007년부터 2016년까지 pm_seoul로 정의하고 리스트를 만든..