A list as an item of another list.
Accessing Nested List
Code
PYTHON
Output
Accessing Items of Nested List
Example - 1
Code
PYTHON
Output
Example - 2
Code
PYTHON
Output
String Formatting
Code
PYTHON
String formatting simplifies this concatenation.
It increases the readability of code and type conversion is not required.
Add Placeholders
Add placeholders
{}
where the string needs to be formatted.PYTHON
Inserts values inside the string’s placeholder
{}
Code
PYTHON
Output
Number of Placeholders
Code
PYTHON
Output
Numbering Placeholders
Numbering placeholders, will fill values according to the position of arguments.
Code
PYTHON
Input
Output
Code
PYTHON
Input
Output
Naming Placeholder
Naming placeholders will fill values according to the keyword arguments.
Code
PYTHON