Re: cleaner version of variable, new line

2018-05-24 Thread asa32sd23
On Thursday, May 24, 2018 at 8:51:07 PM UTC-4, asa3...@gmail.com 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) > > > > kitti > ===^ > kitti more legible that way... thks -- https://mail.python.

Re: cleaner version of variable, new line

2018-05-24 Thread Steven D'Aprano
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 -- https://mail.python.org/mailma

Re: cleaner version of variable, new line

2018-05-24 Thread MRAB
On 2018-05-25 01:50, asa32s...@gmail.com 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) kitti ===^ kitti When printing, I'd probably just go for something clear and simple: print(s1) print("=" * i + "

cleaner version of variable, new line

2018-05-24 Thread asa32sd23
hi just seeing if there is a cleaner way to write this. s1= "kitti" s2= 'kitti' i= 3 print(s1+ "\n" + "="*i + "^" + "\n" +s2) > kitti ===^ kitti -- https://mail.python.org/mailman/listinfo/python-list