Nitin

11%
Flag icon
When we use the format() method, we do not use %s, %f or %d as placeholders. Instead we use braces { }, like this: message = 'The price of this {0:s} laptop is {1:d} USD and the exchange rate is {2:4.2f} USD to 1 EUR'.format('Apple', 1299, 1.235235245)
Learn Python in One Day and Learn It Well: Python for Beginners with Hands-on Project
Rate this book
Clear rating
Open Preview