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)

 

 

posted @ 2016-11-14 14:35  听风呤  阅读(127)  评论(0编辑  收藏  举报