3 ms·
For printing strings, there is more than one way to do it in Python; differently readable for. print("""It turns out that {} has {} kids named {}""".format
by fragmede 5y ago
For printing strings, there is more than one way to do it in Python; differently readable for.
print("""It turns out that {} has {} kids named {}""".format(
TV[family]['lead'],
len(TV[family]['kids'],
', '.join(*[kid.name for kid in TV[family]['kids']]*)
)
It doesn't use the nifty f string formatter, but the English sentence part is a bit easier to read.