Else

else

1 Bash[편집]

He="John Smith"
if [ "$He" = "John Smith" ]; then
	echo "He is John Smith"
else
	echo "He is not John Smith"
fi
# He is John Smith

2 PHP[편집]

16px-Crystal_Clear_app_xmag.svg.png PHP else 문서를 참고하십시오.
if ( 1 == 1 ) {
	echo "True";
} else {
	echo "False";
}
# True
if ( 1 == 2 ):
	echo "True";
else:
	echo "False";
endif;
# False

3 Python[편집]

if 1==1:
	print(True)
else:
	print(False)
# True
if 1==2:
	print(True)
else:
	print(False)
# False

4 Perl[편집]

if ( 1 eq 1 ) {
	print "True";
} else {
	print "False";
}
# True
if ( 1 eq 2 ) {
	print "True";
} else {
	print "False";
}
# False

5 Ruby[편집]

if 43 > 42
	puts 'true'
else
	puts 'false'
end
# true

6 같이 보기[편집]

7 참고[편집]

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