Created
January 2, 2017 01:14
-
-
Save yunho0130/33e1b6e60ddbc1d44c1212f3d5fe7140 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
""" | |
Created on Mon Jan 02 09:56:58 2017 | |
@author: Yunho | |
""" | |
temp_list = ['사과', '배', '딸기'] | |
print temp_list | |
#for i in temp_list: | |
# print i | |
# append | |
temp_list.append('포도') | |
for i in temp_list: | |
print i | |
# .sort() | |
temp_list.sort() | |
for i in temp_list: | |
print i | |
# del | |
del temp_list[2] | |
print "=="*6 | |
for i in temp_list: | |
print i | |
# mutable | |
temp_list[1] = '감' | |
print "=="*6 | |
for i in temp_list: | |
print i | |
another_list = temp_list | |
another_list[0] = '초콜릿' | |
print "=="*6 | |
for i in temp_list: | |
print i | |
list2 = temp_list[:] | |
print "=="*6 | |
for i in list2: | |
print i | |
list2[0] = '자전거' | |
print "=="*6 | |
for i in temp_list: | |
print i | |
print "=="*6 | |
for i in list2: | |
print i |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment