Skip to content

Instantly share code, notes, and snippets.

View nattybear's full-sized avatar

Joonkyu Park nattybear

View GitHub Profile
dic1 = { 'zero' : 0,
'one' : 1,
'two' : 2,
'three' : 3,
'four' : 4,
'five' : 5,
'six' : 6,
'seven' : 7,
'eight' : 8,
'nine' : 9,
@nattybear
nattybear / sum_digit.py
Created May 30, 2017 08:50
[4주차 미션] 자릿수 늘리며 더하기
sum = 0
for i in range(1, 7):
for j in range(i):
sum = sum + (10 ** j)
print(sum)
@nattybear
nattybear / compress_char.py
Created May 31, 2017 09:32
점프투파이썬 연습문제 - 글자 압축하기
# 사용자 입력 받기
s = input()
# 글자를 판단할 변수 생성
a = ''
# 글자수를 셀 변수 생성
cnt = 0
for i in s:
@nattybear
nattybear / float.c
Created June 1, 2017 00:47
C언어에서 실수형 자료형의 표현
#include <stdio.h>
int main() {
float a = 5.789F;
printf("%d\n", a);
return 0;
}
@nattybear
nattybear / dup.py
Created June 1, 2017 01:35
점프투파이썬 - 중복 숫자 문제
# 0~9까지 문자로 된 숫자를 원소로 갖는 set을 정의한다.
a = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9'}
def func(s):
# 입력한 원소의 총 개수가 10개가 아니라면 거짓을 리턴한다.
if len(s) != 10: return False
# 리스트 함수를 이용해서 한글자씩 쪼갠다.
s = list(s)
@nattybear
nattybear / weird.py
Created June 1, 2017 23:50
알고스팟 초보용 문제 - 구현
def func():
# 사용자 입력을 받는다.
n = int(input())
# 약수를 저장할 리스트 변수를 생성한다.
d = []
# 1부터 입력받은 수까지 반복한다.
# 이 때 나눈 나머지가 0인 수
# 즉 나누어 떨어지는 수라면
@nattybear
nattybear / kyh.md
Created June 3, 2017 10:15
코딩 멘토 일지

.

@nattybear
nattybear / draprect.py
Created June 3, 2017 13:31
알고스팟 왕초보 구현 문제
# 문자열로 된 ('x', 'y') 좌표를 받아서
# 내장함수 map을 이용하여 숫자 좌표를 리턴한다.
def parse(x):
x = x.split()
return map(int, x)
def func():
# 사용자 입력을 세번 받는다.
pos1 = input()
@nattybear
nattybear / drawrect2016.py
Created June 3, 2017 13:38
알고스팟 왕초보구현 문제
for i in range(input()):
a = raw_input()
b = raw_input()
c = raw_input()
x = []
y = []
z = []
def d(e):
# 글자로만 구성된 문자열
str1 = "hello"
# 숫자가 포함된 문자열
str2 = "hello123"
# isdigit()는 문자열 객체의 메소드이다.
# 문자열에 숫자가 포함되어 있는지 아닌지를
# 검사해서 숫자가 있으면 참을 리턴하고
# 숫자가 없으면 거짓을 리턴한다.