Python--print学习
1 #!/usr/bin/env python 2 # -*- coding:utf-8 -*- 3 # Author:Huanglinsheng 4 #把用户的输入的参数当作一条命令交给os.system来执行 5 6 import sys,os 7 8 print(sys.argv[1:]) 9 os.system(''.join(sys.argv[1:])) 10 11 name = "hc" 12 #PS: 字符串是 %s;整数 %d;浮点数%f 13 print("I am %s!!!" %name) 14 15 name_list = ['hc','hls','hht'] 16 for index,name in enumerate(name_list): 17 print(index,name) 18 #print('name_list[{}] = {}'.format(index,name))
posted on 2018-07-23 16:50 huanglinsheng 阅读(110) 评论(0) 编辑 收藏 举报