print variable into a string : Output Format : Development PYTHON examples


PYTHON examples » Development » Output Format »

 

print variable into a string


print variable into a string


x = 42
y = 3.14
z = "george"
print 'result = %d' % x                 # prints: result = 42
print 'answers are: %d %f' % (x,y)      # prints: answers are: 42 3.14
print 'hello %s' % z                    # prints: hello george

           
       



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON examples

 Navioo Development
» Output Format