Optimizing Small Python Code

Greg Ewing greg.ewing at canterbury.ac.nz
Tue Jun 22 19:04:40 EDT 2021


On 23/06/21 3:03 am, Kais Ayadi wrote:
> for n in range(1, 7):
>      print (n)
>      for x in range(0, n):
>          print("     ", x)
> 
> can this code be more optimised?

Optimised for what? Readability? Execution speed? Code size?
Memory usage?

-- 
Greg


More information about the Python-list mailing list