I have the following code:
def xyz(a):
return 2*a
def abc(b):
return 4*b
print "a is :: "+xyz(1)"b is :: "+abc(2)
and I would like my output to be like this - a is :: 2 b is :: 8
. (that is, both in the same line).
I have the following code:
def xyz(a):
return 2*a
def abc(b):
return 4*b
print "a is :: "+xyz(1)"b is :: "+abc(2)
and I would like my output to be like this - a is :: 2 b is :: 8
. (that is, both in the same line).
1)
print "a is :: %(xyz)s b is :: %(abc)s" % {'xyz':xyz(1), 'abc':abc(2)}
2) Like in the comment by @MartijnPieters you want to make a circular import that you should avoid. I am giving a link to avoid makeing a copy of a perfect topic about circular imports