?
=?iso-8859-1?B?bW9vcJk=?=
Hi,
I want to make a print statement as the title appears. The point is,
the print function can understand which variable corresponds to the
desired parameter name inside the pattern.
In C# print functions, the syntax is like
print("my name is{0}, and {1}-year old {2}", name, age, gender);
But I want to do a little further to make the print function knows
which argument is going to fill the slot in the pattern string, even
the arguments are not ordered in place:
print("my name is {name}, and {age}-year old {gender}", age, gender,
name);
or it will have exception burst out when there is no suitable
paramenter:
print("hello, {name}", age);
can we do that? Thx!
I want to make a print statement as the title appears. The point is,
the print function can understand which variable corresponds to the
desired parameter name inside the pattern.
In C# print functions, the syntax is like
print("my name is{0}, and {1}-year old {2}", name, age, gender);
But I want to do a little further to make the print function knows
which argument is going to fill the slot in the pattern string, even
the arguments are not ordered in place:
print("my name is {name}, and {age}-year old {gender}", age, gender,
name);
or it will have exception burst out when there is no suitable
paramenter:
print("hello, {name}", age);
can we do that? Thx!