python 基礎(二)
阿新 • • 發佈:2017-12-22
clas for php rgs echo ostream ech god c++
Hello World程序
print("Hello World!")
然後執行輸出:
Hello World!
在交互式下執行
Python 2.7.14 (v2.7.14:84471935ed, Sep 16 2017, 20:25:58) [MSC v.1500 64 bit (AMD64)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> print("Hello World!")
Hello World!
對比其他語言的Hello World
C++ # include <iostream> int main(void) { std::cout<<"Hello World!"; }
C語言
# include <stdio.h>
int main(void)
{
printf("\nHello World!");
return 0;
}
Java語言
public class HelloWorld{
// 程序的入口
public static void main(String args[]){
// 向控制臺輸出信息
System.out.printIn("Hello World!");
}
}
PHP
<?pjp
echo "Hello World!";
?>
Ruby
puts "Hello World!"
Golang
package main
import "fmt"
func main(){
fmt.Printf("Hello World!\n God Bless You!")
}
```
變量\字符編碼
python 基礎(二)