+ 1

Guys how to print two outputs in python using /n with no space at beginning

n=int(input()) print(n*1000,'\n',n*100000) When running this code there is a space in second output help please

4th May 2020, 11:38 AM
Binto_ Sharon
Binto_ Sharon - avatar
3 Réponses
+ 4
print(str(n*1000)+'\n'+str(n*100000))
4th May 2020, 11:43 AM
Abhay
Abhay - avatar
+ 1
Thank you
6th May 2020, 4:40 AM
Binto_ Sharon
Binto_ Sharon - avatar
0
Another option is to use f-string (or string.format() for older versions). print(f"{n*1000}\n{n*100000}")
4th May 2020, 3:21 PM
Kishalaya Saha
Kishalaya Saha - avatar