Python String Format Example

The most basic way to construct a dynamic string in Python is with simple concatenation.

Python




xxxxxxxxxx
1


 
1
days = 28
2
month = 'February"
3
 
          
4
my_string = month + ' is the shortest month of the year, with '+ str(days) + ' days.'