Talk:Show the (decimal) value of a number of 1s appended with a 3, then squared: Difference between revisions
Talk:Show the (decimal) value of a number of 1s appended with a 3, then squared (view source)
Revision as of 23:08, 4 October 2021
, 2 years ago→Python 'one-liner' added before earlier submissions
Line 45:
and might be more legible if rearranged into two or three lines. [[User:Hout|Hout]] ([[User talk:Hout|talk]]) 22:49, 4 October 2021 (UTC)
Perhaps, for example, using the slightly cleaner literal string interpolation idiom, as something like:
<lang python>[
print(f'{"1" * i}3^2 = {int("1" * i + "3") ** 2}')
for i in range(0, 8)
]</lang>
[[User:Hout|Hout]] ([[User talk:Hout|talk]]) 23:08, 4 October 2021 (UTC)
|