-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstudy11.py
More file actions
50 lines (34 loc) · 883 Bytes
/
Copy pathstudy11.py
File metadata and controls
50 lines (34 loc) · 883 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import re
def hello():
print("안녕하세요!.")
hello()
def say_hello(name):
print("%s님 안녕하세요!: " % name)
say_hello('김세민')
say_hello('최태준')
say_hello('이승빈')
def even_odd(n):
if n % 2 == 0:
print("%d -> 짝수" % n)
else:
print("%d -> 홀수" % n)
even_odd(15)
even_odd(26)
def inch_to_cm(inch):
cm = inch * 2.54
return cm
num = int(input('인치를 입력하세요: '))
result = inch_to_cm(num)
print("%d inch => %.2fcm" % (num, result))
def besu5(n):
if n % 5 == 0:
rel = True
else:
rel = False
return rel
num = (input('양의 정수를 입력하세요: '))
result = besu5(num)
if result == True:
print("%d -> 5의 배수이다." % num)
else:
print("%d -> 5의 배수가 아니다." % num)