Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
python_study
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
Minseong Kwon
python_study
Commits
831d0259
Commit
831d0259
authored
6 years ago
by
Minseong Kwon
Browse files
Options
Downloads
Patches
Plain Diff
Upload New File
parent
a811b659
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
12-04수업내용1.py
+125
-0
125 additions, 0 deletions
12-04수업내용1.py
with
125 additions
and
0 deletions
12-04수업내용1.py
0 → 100644
+
125
−
0
View file @
831d0259
Python
3.7
.
1
(
v3
.
7.1
:
260
ec2c36a
,
Oct
20
2018
,
14
:
05
:
16
)
[
MSC
v
.
1915
32
bit
(
Intel
)]
on
win32
Type
"
help
"
,
"
copyright
"
,
"
credits
"
or
"
license()
"
for
more
information
.
>>>
a
=
200
>>>
def
loca_test
():
a
=
200
print
(
a
)
>>>
a
200
>>>
loca_test
()
200
>>>
a
=
100
>>>
def
local_test
():
a
=
200
print
(
a
)
>>>
a
100
>>>
local_test
()
200
>>>
def
local_test
():
global
a
print
(
a
)
a
=
200
>>>
local_test
<
function
local_test
at
0x031628A0
>
>>>
local_test
()
100
>>>
a
=
333
>>>
local_test
()
333
>>>
a
200
>>>
````
a
SyntaxError
:
invalid
syntax
>>>
a
200
>>>
local_test
()
200
>>>
a
=
333
>>>
a
333
>>>
local_test
)(
SyntaxError
:
invalid
syntax
>>>
local_test
()
333
>>>
def
print
(
a
)
SyntaxError
:
invalid
syntax
>>>
def
print
(
a
):
p
=
print
SyntaxError
:
expected
an
indented
block
>>>
def
print_some
SyntaxError
:
invalid
syntax
>>>
def_print_some
:
SyntaxError
:
invalid
syntax
>>>
def
print_some
SyntaxError
:
invalid
syntax
>>>
def
print_some
:
SyntaxError
:
invalid
syntax
>>>
def
print_some
():
fac
SyntaxError
:
expected
an
indented
block
>>>
fac
Traceback
(
most
recent
call
last
):
File
"
<pyshell#42>
"
,
line
1
,
in
<
module
>
fac
NameError
:
name
'
fac
'
is
not
defined
>>>
fac
Traceback
(
most
recent
call
last
):
File
"
<pyshell#43>
"
,
line
1
,
in
<
module
>
fac
NameError
:
name
'
fac
'
is
not
defined
>>>
fac
(
200
)
Traceback
(
most
recent
call
last
):
File
"
<pyshell#44>
"
,
line
1
,
in
<
module
>
fac
(
200
)
NameError
:
name
'
fac
'
is
not
defined
>>>
f
Traceback
(
most
recent
call
last
):
File
"
<pyshell#45>
"
,
line
1
,
in
<
module
>
f
NameError
:
name
'
f
'
is
not
defined
>>>
def
fac
(
n
=
0
)
SyntaxError
:
invalid
syntax
>>>
def
fac
(
n
=
0
):
s
=
1
if
n
==
0
:
return
1
if
n
>
0
:
s
=
s
*
n
print
(
s
)
return
fac
(
n
-
1
)
*
n
>>>
fac
(
10
)
10
9
8
7
6
5
4
3
2
1
3628800
>>>
fac
(
10
)
10
9
8
7
6
5
4
3
2
1
3628800
>>>
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