Saturday, September 12, 2020

389 - Replacement field {} with the member operators

 389 - Replacement field {} with the member operators


 

 

Replacement field {} with the member operators

 

Code-1

var1 , var2 , var3 = 11,12,13

print('variable1={0}'.format(var1))

 

output:

variable1 = 11

 

Code-2

var1 , var2 , var3 = 11,12,13

print('variable1={0},variable2={1},variable3={2}'.format(var1,var2,var3))

 

output:

variable1=11,variable2=12,variable3=13

 

Note :: In the above print statement , the values {0},{1},{2}

represent the values of var1 , var2 , var3 respectively

 

 


No comments:

Post a Comment

Durga Puja in Odisha

 Durga Puja in Odisha