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
b4a7ac4c
Commit
b4a7ac4c
authored
6 years ago
by
KimMinSeob
Browse files
Options
Downloads
Patches
Plain Diff
Upload New File
parent
9cdfdef2
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
LectureNote - list,tuple, dict.py
+171
-0
171 additions, 0 deletions
LectureNote - list,tuple, dict.py
with
171 additions
and
0 deletions
LectureNote - list,tuple, dict.py
0 → 100644
+
171
−
0
View file @
b4a7ac4c
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
.
>>>
#리스트, 튜플, 딕셔너리
>>>
a
=
[
'
oop
'
,
'
python
'
,
'
java
'
]
>>>
a
[
'
oop
'
,
'
python
'
,
'
java
'
]
>>>
a
[
0
]
'
oop
'
>>>
a
[
1
]
'
python
'
>>>
a
[
2
]
'
java
'
>>>
a
[
3
]
Traceback
(
most
recent
call
last
):
File
"
<pyshell#6>
"
,
line
1
,
in
<
module
>
a
[
3
]
IndexError
:
list
index
out
of
range
>>>
b
=
[
1
,
2
,
3
,
4
,]
>>>
b
[
1
,
2
,
3
,
4
]
>>>
c
=
[
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
]
>>>
c
[
0
:
3
]
[
1
,
2
,
3
]
>>>
c
[
4
:
7
}
SyntaxError
:
invalid
syntax
>>>
c
[
5
:
8
]
[
6
,
7
,
8
]
>>>
c
[:
7
]
[
1
,
2
,
3
,
4
,
5
,
6
,
7
]
>>>
a
=
[
1
,
2
,
3
,
4
]
>>>
b
=
[
5
,
6
,
7
,
8
]
>>>
a
+
b
[
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
]
>>>
a
[
2
]
=
10
>>>
a
[
1
,
2
,
10
,
4
]
>>>
a
[
3
]
=
0
>>>
a
[
1
,
2
,
10
,
0
]
>>>
len
(
a
)
4
>>>
a
.
append
(
50
)
>>>
a
[
1
,
2
,
10
,
0
,
50
]
>>>
a
.
extend
([
0
,
2
,
4
,
8
])
>>>
a
[
1
,
2
,
10
,
0
,
50
,
0
,
2
,
4
,
8
]
>>>
a
.
insert
(
3
,
500
)
>>>
a
[
1
,
2
,
10
,
500
,
0
,
50
,
0
,
2
,
4
,
8
]
>>>
a
.
insert
(
1
,
100
)
>>>
a
[
1
,
100
,
2
,
10
,
500
,
0
,
50
,
0
,
2
,
4
,
8
]
>>>
a
.
remove
(
2
)
>>>
a
[
1
,
100
,
10
,
500
,
0
,
50
,
0
,
2
,
4
,
8
]
>>>
a
.
remove
(
2
)
>>>
a
[
1
,
100
,
10
,
500
,
0
,
50
,
0
,
4
,
8
]
>>>
a
.
pop
(
4
)
0
>>>
a
[
1
,
100
,
10
,
500
,
50
,
0
,
4
,
8
]
>>>
a
.
index
(
10
)
2
>>>
a
.
index
(
10000
)
Traceback
(
most
recent
call
last
):
File
"
<pyshell#37>
"
,
line
1
,
in
<
module
>
a
.
index
(
10000
)
ValueError
:
10000
is
not
in
list
>>>
a
.
append
(
1
)
>>>
a
.
append
(
1
)
>>>
a
[
1
,
100
,
10
,
500
,
50
,
0
,
4
,
8
,
1
,
1
]
>>>
a
.
count
(
1
)
3
>>>
a
.
sort
()
>>>
a
[
0
,
1
,
1
,
1
,
4
,
8
,
10
,
50
,
100
,
500
]
>>>
a
.
sort
(
reverse
=
true
)
Traceback
(
most
recent
call
last
):
File
"
<pyshell#44>
"
,
line
1
,
in
<
module
>
a
.
sort
(
reverse
=
true
)
NameError
:
name
'
true
'
is
not
defined
>>>
a
.
sort
(
reverse
=
True
)
>>>
a
[
500
,
100
,
50
,
10
,
8
,
4
,
1
,
1
,
1
,
0
]
>>>
a
.
reverse
<
built
-
in
method
reverse
of
list
object
at
0x112353448
>
>>>
a
.
reverse
()
>>>
a
[
0
,
1
,
1
,
1
,
4
,
8
,
10
,
50
,
100
,
500
]
>>>
a
=
(
1
,
2
,
3
)
>>>
type
(
a
)
<
class
'
tuple
'
>
>>>
a
(
1
,
2
,
3
)
>>>
a
=
1
,
2
,
3
,
4
,
>>>
a
(
1
,
2
,
3
,
4
)
>>>
type
(
a
)
<
class
'
tuple
'
>
>>>
a
=
(
1
,)
>>>
type
(
a
)
<
class
'
tuple
'
>
>>>
a
=
(
1
)
>>>
type
(
a
)
<
class
'
int
'
>
>>>
#요소가 한개일때 콤마 찍어줘야 하는 이유
>>>
b
=
1
,
>>>
type
(
b
)
<
class
'
tuple
'
>
>>>
b
(
1
,)
>>>
a
=
(
1
,
2
,
3
,
4
)
>>>
a
[
0
]
1
>>>
a
[
1
]
2
>>>
a
[
2
]
3
>>>
a
[
3
]
4
>>>
a
[
1
]
=
5
Traceback
(
most
recent
call
last
):
File
"
<pyshell#69>
"
,
line
1
,
in
<
module
>
a
[
1
]
=
5
TypeError
:
'
tuple
'
object
does
not
support
item
assignment
>>>
len
(
a
)
4
>>>
one
,
two
,
three
,
four
=
a
>>>
a
(
1
,
2
,
3
,
4
)
>>>
one
1
>>>
two
2
>>>
three
3
>>>
four
4
>>>
one
,
two
,
three
=
a
Traceback
(
most
recent
call
last
):
File
"
<pyshell#77>
"
,
line
1
,
in
<
module
>
one
,
two
,
three
=
a
ValueError
:
too
many
values
to
unpack
(
expected
3
)
>>>
dic
=
{}
>>>
dic
[
'
python
'
]
=
'
www.pthon.org
'
>>>
dic
[
'
microsoft
'
]
=
'
www.microsoft.com
'
>>>
dic
[
'
apple
'
]
=
'
www.apple.com
'
>>>
dic
[
'
phthon
'
]
Traceback
(
most
recent
call
last
):
File
"
<pyshell#82>
"
,
line
1
,
in
<
module
>
dic
[
'
phthon
'
]
KeyError
:
'
phthon
'
>>>
dic
[
'
python
'
]
'
www.pthon.org
'
>>>
dic
[
'
microsoft
'
]
'
www.microsoft.com
'
>>>
type
(
dic
)
<
class
'
dict
'
>
>>>
dic
{
'
python
'
:
'
www.pthon.org
'
,
'
microsoft
'
:
'
www.microsoft.com
'
,
'
apple
'
:
'
www.apple.com
'
}
>>>
dic
.
keys
()
dict_keys
([
'
python
'
,
'
microsoft
'
,
'
apple
'
])
>>>
dic
.
values
()
dict_values
([
'
www.pthon.org
'
,
'
www.microsoft.com
'
,
'
www.apple.com
'
])
>>>
dic
.
items
()
dict_items
([(
'
python
'
,
'
www.pthon.org
'
),
(
'
microsoft
'
,
'
www.microsoft.com
'
),
(
'
apple
'
,
'
www.apple.com
'
)])
>>>
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