这周主要学习了以下知识点:
1.python的运行方式有以下两种:
python hellotest.py
./hellotest.py #采用这种方式必须在脚本文件中注释所使用的python解释器,如下:
#!/usr/bin/env python3
print("hello,world")
2.python的注释方式,两种:
#单行注释方式
'''
第一种多行注释方式
'''
"""
第二种多行注释方式
"""
3.格式化输出的三种方式
#!/usr/bin/env python3
# _*_ coding:utf-8 _*_
# _*_ Author:Peter.Zou _*
print('please input your information')
name = input("name:")
age = input("age:")
add = input("add:")
#the first formatoutput
print("the first formatoutput")
info1 = '''
------------------the info of %s ---------------------
name %s
age %s
add %s
-------------------------------------------------------
''