.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dic1 = { 'zero' : 0, | |
'one' : 1, | |
'two' : 2, | |
'three' : 3, | |
'four' : 4, | |
'five' : 5, | |
'six' : 6, | |
'seven' : 7, | |
'eight' : 8, | |
'nine' : 9, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sum = 0 | |
for i in range(1, 7): | |
for j in range(i): | |
sum = sum + (10 ** j) | |
print(sum) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 사용자 입력 받기 | |
s = input() | |
# 글자를 판단할 변수 생성 | |
a = '' | |
# 글자수를 셀 변수 생성 | |
cnt = 0 | |
for i in s: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main() { | |
float a = 5.789F; | |
printf("%d\n", a); | |
return 0; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def func(): | |
# 사용자 입력을 받는다. | |
n = int(input()) | |
# 약수를 저장할 리스트 변수를 생성한다. | |
d = [] | |
# 1부터 입력받은 수까지 반복한다. | |
# 이 때 나눈 나머지가 0인 수 | |
# 즉 나누어 떨어지는 수라면 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 문자열로 된 ('x', 'y') 좌표를 받아서 | |
# 내장함수 map을 이용하여 숫자 좌표를 리턴한다. | |
def parse(x): | |
x = x.split() | |
return map(int, x) | |
def func(): | |
# 사용자 입력을 세번 받는다. | |
pos1 = input() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for i in range(input()): | |
a = raw_input() | |
b = raw_input() | |
c = raw_input() | |
x = [] | |
y = [] | |
z = [] | |
def d(e): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 글자로만 구성된 문자열 | |
str1 = "hello" | |
# 숫자가 포함된 문자열 | |
str2 = "hello123" | |
# isdigit()는 문자열 객체의 메소드이다. | |
# 문자열에 숫자가 포함되어 있는지 아닌지를 | |
# 검사해서 숫자가 있으면 참을 리턴하고 | |
# 숫자가 없으면 거짓을 리턴한다. |