I have recently been setting up a Thermometer with my Pi, and I have noticed a line of code in a tutorial which I am using, but I am unsure what it is doing exactly, so I am hoping to research and have it clearer in my mind...
The line is:
Code: Select all
print 'Temp={0:0.1f}*C Humidity={1:0.1f}%'.format(t,h)Code: Select all
print 'Hi, My name is %s and my age is %s years' % (name,age)Can anyone please either explain what the code is doing in my first example? Or give me something I can google to research myself?
Thanks very much for your time.