cleaner version of variable, new line

Steven D'Aprano steve+comp.lang.python at pearwood.info
Thu May 24 22:19:21 EDT 2018


On Thu, 24 May 2018 17:50:53 -0700, asa32sd23 wrote:

> hi just seeing if there is a cleaner way to write this.
>  
> s1= "kitti"
> s2= 'kitti'
> i= 3
> print(s1+ "\n" + "="*i + "^" + "\n" +s2)


s = "kitti"
i = 3
print(s, "="*i + "^", s, sep='\n')





-- 
Steve




More information about the Python-list mailing list