-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bee2eef
commit 4ec06f8
Showing
8 changed files
with
99 additions
and
2 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
cnt=0 | ||
|
||
if cnt == 30: | ||
print("number 1") | ||
|
||
print("number 2") | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
count = 0 | ||
for i in range(0, 10): | ||
count = count + 1 | ||
|
||
print(count) | ||
|
||
for i, value in enumerate(['kium', 'samsung', 'kakao']): | ||
print("%s is numeric, %s is value" % (i,value)) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
|
||
cnt = 0 | ||
repeat_boolean = True | ||
while repeat_boolean: | ||
print("%s while statement is running" % cnt) | ||
cnt = cnt+1 | ||
if cnt == 30: | ||
repeat_boolean = False | ||
print("the end") |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
|
||
# like a javascript array | ||
# tuple is not able to add or update | ||
a_tuple = {"kiumn","daesin", "kakao"} | ||
print(a_tuple) | ||
|
||
a_len = len(a_tuple) | ||
print(a_len) | ||
|
||
a_type = type(a_tuple) | ||
print(a_type) | ||
|
||
for value in a_tuple: | ||
print(value) | ||
|
||
for index, value in enumerate(a_tuple): | ||
print("%s is index, %s is value" % (index, value)) | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
a_list = ["list1", "list2", "list3"] | ||
|
||
print(a_list) | ||
|
||
for index,value in enumerate(a_list): | ||
print("%s, %s" %(index,value)) | ||
|
||
|
||
a_list = ["a_list1", "a_list2", "a_list3"] | ||
b_list = ["b_list1", "b_list2"] | ||
|
||
a_list.append(b_list) | ||
|
||
print(a_list) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# like a map of JAVA | ||
a_dict = {"key 1" : "value 1" | ||
,"key 2" : "value 2" | ||
,"key 3" : "value 3"} | ||
|
||
print(type(a_dict)) | ||
print(a_dict) | ||
print(a_dict['key 1']) | ||
|
||
for key in a_dict: | ||
print('%s is key. %s is value.' % (key, a_dict[key])) | ||
|
||
a_dict.update({"key 4" : "value 4", "key 5" : "value 5"}) | ||
print(a_dict) | ||
|
||
for value in a_dict.keys(): | ||
print("value : %s" % value) | ||
if value == "key 1": | ||
print("222222222222222222222") | ||
elif value == "key 2": | ||
print("33333333333333333333") | ||
else: | ||
print("44444444444444444444") | ||
|
||
|
||
#like a map inner map of JAVA | ||
b_dict = {"bkey 1" : | ||
{"bkey 11" : "bvalue11" | ||
,"bkey 12" : "bvalue122" | ||
} | ||
} | ||
|
||
print(b_dict) | ||
print(b_dict['bkey 1']['bkey 12']) | ||
|
||
|