0
python string format ques two
can anyone help me I got abra part right but not the rest thanks Shad
1 Antwort
0
It's the simplest among the two ways. You could put something as a keyword in your string
" put a keyword {a} curly brackets and pass your object for that {pos} through the keyword in string formatting. ".format(a='in' , pos ='position')
you could use a combination of positional arguments and keyword arguments , but make sure to mention the positional arguments first in the string formatting .
.format(3,'eggs',x=sum) - correct
.format (3,x=sum,'eggs') - incorrect
hope this helps