I’m trying to get used to the new formatting options in python-3.
Is there simpler way of printing sequence of number pairs (two numbers) in python3 ?
for x in range(0,n): # [0, n-1]
print("{} {}".format(x, x*x));
If this is the shortest and simplest way, please, could you ensure me?
P.S. I am asking about “new” formatting options, due to the fact Old String Formatting Operations has become “The formatting operations described here are obsolete and may go away in future versions of Python.”.
1 Answer