함수 정의

Jmnote (토론 | 기여)님의 2014년 8월 21일 (목) 10:14 판 (→‎Python)
function
def

1 Bash

function sayhello () {
	echo "hello"
}
sayhello
# hello

2 JavaScript

function greet() {
	console.log("hello");
}
greet();
// hello
var greet = function() {
	console.log("hello");
}
greet();
// hello

3 PHP

function greet() {
	print("hello");
}
greet();
# hello

4 Python

def greet():
	print('hello')

greet()
# hello
def show_ answer():
	print(42)

show_answer()
# 42

5 Ruby

def sayhello
   puts "hello" 
end
sayhello
# hello

6 같이 보기

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}