-
Notifications
You must be signed in to change notification settings - Fork 0
/
연습_7.py
37 lines (33 loc) · 807 Bytes
/
연습_7.py
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
def dict_3X(n):
dict = {}
num = 1
for i in range(1,n+1):
if '3' in str(num):
while '3' in str(num):
num += 1
if num % 3 == 0:
num += 1
dict[i] = num
num += 1
else:
dict[i] = num
num += 1
else:
if num % 3 == 0:
num += 1
if '3' in str(num):
num += 1
dict[i] = num
num += 1
else:
dict[i] = num
num += 1
else:
dict[i] = num
num += 1
return dict
print(dict_3X(50))
a = 11
if a % 3 == 0 or '3' in str(a):
print(a)
print(a+1)