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!")
}
```