"함수 print()"의 두 판 사이의 차이

75번째 줄: 75번째 줄:


==Python==
==Python==
{{참고|파이썬 print}}
[[category: Python]]
[[category: Python]]
*Python 2.x
*Python 2.x

2015년 11월 11일 (수) 15:22 판

  다른 뜻에 대해서는 리눅스 echo 문서를 참조하십시오.
echo
print
Write

1 Bash

echo "Hello World!"
# Hello World!
STR="Hello World!"
echo $STR
# Hello World!
echo -n 123
echo -n ABC
# 123ABC

2 C#

Console.Write("Hello");

3 Java

System.out.print("hello");

4 JavaScript

document.write("hello");

5 Perl

print 'hello';

6 PHP

echo 'hello';
echo "hello";
echo('hello');
echo("hello");

$greeting = 'hello';
$greeting = "hello";
echo $greeting;
echo "$greeting";
echo '123';
echo 'ABC';
// 123ABC
print 'hello';

7 PowerShell

Write-Host "Hello world!"

8 Python

  • Python 2.x
import sys
sys.stdout.write("hello")
  • Python 3.x
print('hello')
print("hello")
print("hello", end="")
# hello
print("hello","world")
# hello world
print("hello", "world", end="123")
# hello world123

9 Ruby

print "hello"
print "123"
print "ABC"
// 123ABC

10 VB

PRINT "hello"

11 같이 보기