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
# encoding=utf-8 | |
# 2016-12-17 class | |
def function_test(num, val1, val2): | |
def minus(): | |
print val1 - val2 | |
def plus(): | |
print val1 + val2 | |
def muplti(): | |
print val1 * val2 | |
def division(): |
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
# Reflection Example | |
class MyClass: | |
def Hello(self, sText): | |
return 'Hello ' + sText | |
MyClass().Hello('Peter') | |
getattr(globals()['MyClass'](), 'Hello')('Peter') |
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 Sat Dec 24 12:39:11 2016 | |
@author: Yunho | |
""" | |
# CM Lecture for Middle School Students | |
print "ver 1.3" |
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 Sat Dec 24 12:39:11 2016 | |
@author: Yunho | |
""" | |
import sys | |
#print sys.argv[0] # prints python_script.py | |
#print sys.argv[1] # prints var1 |
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 |
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 Tue Jan 03 11:44:16 2017 | |
@author: Yunho | |
""" | |
# 엔진 자동차 | |
class NormalCar(object): | |
def __init__(self,input_name): | |
self.input_name = input_name |
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 Sun Jan 01 17:46:04 2017 | |
@author: Yunho | |
""" | |
def hanoi(num_disks, start_peg, temp_peg ,end_peg): | |
if num_disks == 1: | |
print '{} -> {}'.format(start_peg, end_peg) |
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 Fri Dec 30 06:08:45 2016 | |
@author: Yunho | |
""" | |
def factorial(a): | |
if a == 1: | |
print "크기가 1인 인형이 나옵니다." |
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 Sat Jan 07 12:00:41 2017 | |
@author: Yunho | |
""" | |
def plus(a,b): | |
print a+b | |
return a+b |
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 Sat Jan 07 12:54:55 2017 | |
@author: Yunho | |
""" | |
ab = {'홍길동':['hgdong1111@gmail.com', '010-1234-5678', '조선 개경시 일동면 11']} | |
print ab |