Python: "inline" block / condition to return char?
2 answers
You need to add the else part in 's' if count > 1
, otherwise it is not a valid expression (because the value returned when count <= 1
not specified and Python cannot guess what it should do):
print "The plural of plural is plural{0}. {1}".format(
's' if count > 1 else '', "Isnt't it!?")
+1
a source to share