Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
Python
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
KimMinSeob
Python
Commits
f124450b
Commit
f124450b
authored
6 years ago
by
KimMinSeob
Browse files
Options
Downloads
Patches
Plain Diff
Upload New File
parent
1837eb26
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
exercising for code.py
+187
-0
187 additions, 0 deletions
exercising for code.py
with
187 additions
and
0 deletions
exercising for code.py
0 → 100644
+
187
−
0
View file @
f124450b
Python
3.7
.
1
(
v3
.
7.1
:
260
ec2c36a
,
Oct
20
2018
,
03
:
13
:
28
)
[
Clang
6.0
(
clang
-
600.0
.
57
)]
on
darwin
Type
"
help
"
,
"
copyright
"
,
"
credits
"
or
"
license()
"
for
more
information
.
>>>
#연습문제 1. 1부터 100까지 출력
>>>
for
i
in
range
(
1
,
101
)
SyntaxError
:
invalid
syntax
>>>
for
i
in
range
(
1
,
101
):
print
(
i
)
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
>>>
#문제2. 5의 배수의 총합
>>>
sum
=
0
>>>
for
i
range
(
1
,
100
):
SyntaxError
:
invalid
syntax
>>>
for
i
in
range
(
1
,
1000
):
if
i
%
5
==
0
:
sum
=
sum
+
i
>>>
print
(
sum
)
99500
>>>
sum2
=
0
>>>
for
i
in
range
(
1
,
50
):
if
i
%
5
==
0
:
sum2
=
sum2
+
i
>>>
print
(
sum2
)
225
>>>
#문제3. 학급의 평균 점수
>>>
A
=
[
70
,
60
,
55
,
75
,
95
,
90
,
80
,
80
,
85
,
100
]
>>>
sum
=
0
>>>
for
i
in
A
:
sum
=
sum
+
A
[
i
]
Traceback
(
most
recent
call
last
):
File
"
<pyshell#25>
"
,
line
2
,
in
<
module
>
sum
=
sum
+
A
[
i
]
IndexError
:
list
index
out
of
range
>>>
for
i
in
A
:
sum
=
sum
+
i
>>>
print
(
sum
)
790
>>>
count
=
0
>>>
for
i
in
A
:
count
=
count
+
1
print
(
sum
/
count
)
SyntaxError
:
invalid
syntax
>>>
count
=
0
>>>
sum
=
0
>>>
for
i
in
A
:
count
=
count
+
1
sum
=
sum
+
i
>>>
print
(
sum
/
count
)
79.0
>>>
#문제4. 각 혈액형별 학생수의 합계를 구하시오.
>>>
B
=
[
'
A
'
,
'
B
'
,
'
A
'
,
'
O
'
,
'
AB
'
,
'
AB
'
,
'
O
'
,
'
A
'
,
'
B
'
,
'
O
'
,
'
B
'
,
'
AB
'
]
>>>
a
=
0
>>>
b
=
0
>>>
ab
=
0
>>>
o
=
0
>>>
for
s
in
B
:
if
s
==
'
A
'
:
a
=
a
+
1
elif
s
==
SyntaxError
:
invalid
syntax
>>>
for
s
in
B
:
if
s
==
'
A
'
:
a
=
a
+
1
elif
s
==
'
B
'
:
b
=
b
+
1
elif
s
==
'
AB
'
:
ab
=
ab
+
1
else
:
o
=
o
+
1
>>>
print
(
a
,
b
,
ab
,
o
)
3
3
3
3
>>>
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment