Basic Core Python Programming: A Complete Reference Book to Master Python with Practical Applications (English Edition) by Meenu Kohli

Basic Core Python Programming: A Complete Reference Book to Master Python with Practical Applications (English Edition) by Meenu Kohli

Author:Meenu Kohli [Kohli, Meenu]
Language: eng
Format: azw3
ISBN: 9789390684953
Publisher: BPB Publications
Published: 2021-04-21T00:00:00+00:00


>>> print("Happy Birthday {}".format("Alex"))

Happy Birthday Alex

Example 4.17

What will be the output of the following print command?

>>> print("Happy Birthday {}, have a {} day!!".format("Alex","Great"))

Answer:

Happy Birthday Alex, have a Great day!!

Values that exist in the format() are tuple data types. A value can also be called by referring to its index value as you will see in the next question.

Example 4.18

What will be the output of the following print command?

>>> print("Happy Birthday {1}, have a {0} day!!".format("Great","Alex"))



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.