1基础

  • 打印
print "Hello,World!"

#!/usr/bin/python
#coding=utf-8       ###python2.7指定utf-8才能打印出中文,默认编码是ASCII
print "你好"
  • 接收字符串
i1 = raw_input("")     ###python2.7
i1 = input("")         ###python3.6
  • python内置变量
and exec not
assert finally or
break for pass
class from print
continue global raise
def if return
del import try
elif in while
else is with
except lambda yield

你可能感兴趣的:(1基础)