ex6.py
# -*- coding:utf-8 -*- x = "there are %d type of people." % 10 #IndentationError: unexpected indent 格式没对齐 binary = "binary" do_not = "don't" y = "those who know %s and those who %s." % (binary,do_not) print (x) print (y) #SyntaxError: Missing parentheses in call to 'print' 需要加() print ("i said: %r." % x) print ("i also said: %s."% y) #试下将%s 换成%r 会发现什么? hilarious = False joke_evaluation ="isn't that joke so funny?! %r" % hilarious #print (joke_evaluation % hilarious) print (joke_evaluation) w = "this is the left side of..." e = "a string with a right side." print (w + e)