不免俗的來篇Hello World

進入shell

node
python
python3


Node.js

console.log('Hello World')
//或是代入變數
console.log('%s! %s, %d', 'Hello', 'World', 2014)


Python

#python2
print 'Hello World'
print '%s! %s, %d' % ('Hello', 'World', 2014)

#python3
print ('Hello World')
print ('%s! %s, %d' % ('Hello', 'World', 2014))

輸出結果

Hello World
Hello! World, 2014

執行命令稿

node helloworld.js
python helloworld.py
python3 helloworld3.py


離開shell
node shell中連按兩Ctrl + C
python shell中輸入exit()後執行

arrow
arrow
    文章標籤
    Node.js Python
    全站熱搜

    長風破浪會有時 發表在 痞客邦 留言(0) 人氣()