有中文的时候,开头加入 # -*- coding:utf-8 -*- 有这3行注意下 print “He’s got %s eyes and %s hair.” % (my_eyes,my_hair)print “His teeth are usually %s depending on the coffee.” % my_teethprint “If I add %d,%d,and %d I get %d.” % (my_age,my_height,my_weight,my_age + my_height + my_weight) 后边的%后边不要加东西,不然报错 两个以上变量,后边用括号 疑问:不同类型变量如何处理?
暂无评论