python hello world

初学Python 之,认识简单的输入输出和简单的格式化。

1
2
3
4
5
print("hello world!")
name = input("请输入您的姓名:")
print("姓名:%s" %name)

打印结果:

hello world!
请输入您的姓名:zhang shan feng
姓名:zhang shan feng

print() 和 input() 是python中的 打印和输入,使用非常简单。

我们这里只使用了 print(“%s” %name) 简单的打印格式占位符,python还有其他更多的输出格式。
不要小看输入和输出,任何程序必不可少的就是输入和输出了。

这篇文章就是简单的认识一下 Python 。结束。